static void Main(string[] args) { Del1 d1 = Method1; Del2 d2 = Method2; int a = 39854; int[] arr1 = new int[] { 45, 23, 98, 23, 89, 34, 78, 53, 21, 12 }; int[] arr2 = d1?.Invoke(a); d2?.Invoke(arr1); d2?.Invoke(arr2); Console.WriteLine(d1.Target); Console.WriteLine(d1.Method); Console.WriteLine(d2.Target); Console.WriteLine(d2.Method); }
static void Main(string[] args) { int a = 12345; int[] arr1 = { 10, 20, 30, 40, 50, 60, 70, 80, 90, 99 }; int[] arr2 = { 11, 22, 30, 73, 50, 60, 70, 30, 78, 14 }; Del1 del1 = Class1.IntToArr; Del2 del2 = Class1.Print; del1.Invoke(a); del2.Invoke(del1.Invoke(a)); }
private void Foo2(Del2 del) { var res1 = del(11); var res2 = del.Invoke(22); }