5 event EventHandler Member
;
10 new event EventHandler Member
;
13 interface BA
: B
, A { }
17 public EventHandler _AMember
;
18 public EventHandler _Member
;
20 event EventHandler A
.Member
22 add { _AMember += value; Console.WriteLine ("Setting A Event"); }
23 remove { _AMember -= value; }
26 public event EventHandler Member
28 add { _Member += value; Console.WriteLine ("Setting Direct Event"); }
29 remove { _Member -= value; }
35 public static int Main ()
37 return new Test ().TestMe ();
43 Console
.WriteLine ("Trying to set EventHandler Directly - should set DirectEvent ");
44 c
.Member
+= new EventHandler (f
);
45 if (c
._Member
== null)
49 Console
.WriteLine ("Trying to set EventHandler through A interface - Should set A Event");
50 ((A
) c
).Member
+= new EventHandler (f
);
51 if (c
._AMember
== null)
55 Console
.WriteLine ("Trying to set EventHandler through BA interface - Should set Direct Event");
56 ((BA
) c
).Member
+= new EventHandler (f
);
57 if (c
._Member
== null)
60 Console
.WriteLine ("ok");
64 void f (object sender
, EventArgs e
) { }