1 Code
1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4 usingSystem.Text;5 usingSystem.Threading.Tasks;6 7 namespaceConsoleApplication38 {9 /// <summary>Ten ///This class inherits from EventArgs, which is its subclass One /// </summary> A classTest:eventargs - { - string_name; the string_age; - - Public stringName - { + Get - { + return_name; A } at - Set - { -_name =value; - } - } in - Public string Age to { + Get - { the return_age; * } $ Panax Notoginseng Set - { the_age =value; + } A } the } + - class Program $ { $ Static voidMain (string[] args) - { -Test A =NewTest (); theA.name ="Buddha of the King of Tibet"; - Wuyi //The change of the Richter, the son can replace the father's position the test (a); - Console.readkey (); Wu } - About $ Public Static voidTest (EventArgs e) - { -Test T = E asTest; - Console.WriteLine (t.name); A } + } the -}
2 Show
3 extension
C # console base function's parameter type is EventArgs how to pass a numeric value