2 using System
.Reflection
;
3 using System
.Runtime
.InteropServices
;
5 namespace preservesig_test
9 static int Main(string[] args
)
11 MethodInfo dofoo
= typeof(TestClass
).GetMethod("DoFoo");
12 if ((dofoo
.GetMethodImplementationFlags() & MethodImplAttributes
.PreserveSig
) == 0)
15 dofoo
= typeof(TestClass
).GetProperty("Foo").GetGetMethod ();
16 if ((dofoo
.GetMethodImplementationFlags() & MethodImplAttributes
.PreserveSig
) == 0)
19 dofoo
= typeof(TestClass
).GetEvent("e").GetAddMethod (true);
20 if ((dofoo
.GetMethodImplementationFlags() & MethodImplAttributes
.PreserveSig
) == 0)
23 Console
.WriteLine("Has PreserveSig");
28 public class TestClass
30 public delegate void D ();