4 delegate void SimpleDelegate ();
5 delegate string NotSimpleDelegate (int a);
10 Console.WriteLine ("Test.F from delegate");
12 public static string G (int a) {
13 return "G got: " + a.ToString ();
15 public string H (int a) {
16 return "H got: " + a.ToString () + " and " + data.ToString ();
22 Test test = new Test ();
23 SimpleDelegate d = new SimpleDelegate (F);
24 NotSimpleDelegate d2 = new NotSimpleDelegate (G);
25 NotSimpleDelegate d3 = new NotSimpleDelegate (test.H);
27 Console.WriteLine (d2 (2));
28 Console.WriteLine (d3 (3));