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(); }
public static void Text4(this OldClass O, int x) { Console.WriteLine("Method Four: " + x); }
public static void Text5(this OldClass O) { Console.WriteLine("Method Five:" + O.x); }
public static void Text3(this OldClass O) { Console.WriteLine("Method Three"); }