2002-02-20 Nick Drochak <ndrochak@gol.com>
[mono.git] / mcs / tests / test-26.cs
1 using System;
2
3 public class Blah {
4
5         public delegate int MyDelegate (int i, int j);
6         
7         public int Foo (int i, int j)
8         {
9                 return i+j;
10         }
11
12         public static int Main ()
13         {
14                 Blah f = new Blah ();
15
16                 MyDelegate del = new MyDelegate (f.Foo);
17
18                 MyDelegate another = new MyDelegate (del);
19
20                 int number = del (2, 3);
21
22                 int i = another (4, 6);
23                 
24                 Console.WriteLine ("Delegate invocation of one returned : " + number);
25
26                 Console.WriteLine ("Delegate invocation of the other returned : " + i);
27
28                 if (number == 5 && i == 10)
29                         return 0;
30                 else
31                         return 1;
32
33         }
34
35 }