Пример #1
0
        static void Main(string[] args)
        {
            OldClass obj = new OldClass();

            obj.Test1();
            obj.Test2();
            //Calling exrension methods
            obj.Text3();
            obj.Text4(10);
            obj.Text5();
            Console.ReadLine();
        }
Пример #2
0
 public static void Text4(this OldClass O, int x)
 {
     Console.WriteLine("Method Four: " + x);
 }
Пример #3
0
 public static void Text5(this OldClass O)
 {
     Console.WriteLine("Method Five:" + O.x);
 }
Пример #4
0
 public static void Text3(this OldClass O)
 {
     Console.WriteLine("Method Three");
 }