3 public delegate long MyDelegate (int a);
7 event EventHandler Foo;
9 event MyDelegate TestEvent;
16 event EventHandler X.Foo {
24 public event EventHandler Foo;
26 public event MyDelegate TestEvent;
32 Foo += new EventHandler (callback1);
33 TestEvent += new MyDelegate (callback2);
35 x.Foo += new EventHandler (callback3);
40 Foo (this, new EventArgs ());
44 if (TestEvent (2) != 4)
54 private static void callback1 (object sender, EventArgs e)
59 private static long callback2 (int b)
65 private static void callback3 (object sender, EventArgs e)
73 public delegate int SomeEventHandler();
74 public static event SomeEventHandler BuildStarted;
80 public static int Main ()
84 int result = z.Test ();
89 if (BuildStarted != null) {
92 BuildStarted = new SomeEventHandler (a);
93 if (BuildStarted () != 1)
101 // This class is just to test a bug in mcs; where we used to fail
102 // when accessing a static event, from an instance method.
104 public class Static {
105 public static event EventHandler Test;