2 using System.Reflection;
3 using System.Runtime.CompilerServices;
5 public delegate void DelType ();
9 public event DelType MyEvent;
14 public event DelType MyEvent;
16 public static int Main ()
18 EventInfo ei = typeof (Test).GetEvent ("MyEvent");
19 MethodImplAttributes methodImplAttributes = ei.GetAddMethod ().GetMethodImplementationFlags ();
21 if ((methodImplAttributes & MethodImplAttributes.Synchronized) == 0) {
22 Console.WriteLine ("FAILED");
26 methodImplAttributes = ei.GetRemoveMethod ().GetMethodImplementationFlags ();
27 if ((methodImplAttributes & MethodImplAttributes.Synchronized) == 0) {
28 Console.WriteLine ("FAILED");
32 ei = typeof (S).GetEvent ("MyEvent");
33 methodImplAttributes = ei.GetAddMethod ().GetMethodImplementationFlags ();
35 if ((methodImplAttributes & MethodImplAttributes.Synchronized) != 0) {
36 Console.WriteLine ("FAILED");
40 methodImplAttributes = ei.GetRemoveMethod ().GetMethodImplementationFlags ();
41 if ((methodImplAttributes & MethodImplAttributes.Synchronized) != 0) {
42 Console.WriteLine ("FAILED");