Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes
[mono.git] / mcs / class / corlib / System.Reflection.Emit / EventBuilder.cs
index 94de43595017b1e38ecaaf097be0513d411efdba..2393e2abc9b64a55857808cf1b0c01747bbbc921 100644 (file)
@@ -31,6 +31,7 @@
 // (C) 2001 Ximian, Inc.  http://www.ximian.com
 //
 
+#if !FULL_AOT_RUNTIME
 using System;
 using System.Reflection;
 using System.Reflection.Emit;
@@ -39,22 +40,23 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
-#if NET_2_0
        [ComVisible (true)]
        [ComDefaultInterface (typeof (_EventBuilder))]
-#endif
        [ClassInterface (ClassInterfaceType.None)]
+       [StructLayout (LayoutKind.Sequential)]
        public sealed class EventBuilder : _EventBuilder {
-               string name;
+#pragma warning disable 169, 414
+               internal string name;
                Type type;
                TypeBuilder typeb;
                CustomAttributeBuilder[] cattrs;
-               MethodBuilder add_method;
-               MethodBuilder remove_method;
-               MethodBuilder raise_method;
-               MethodBuilder[] other_methods;
-               EventAttributes attrs;
+               internal MethodBuilder add_method;
+               internal MethodBuilder remove_method;
+               internal MethodBuilder raise_method;
+               internal MethodBuilder[] other_methods;
+               internal EventAttributes attrs;
                int table_idx;
+#pragma warning restore 169, 414
 
                internal EventBuilder (TypeBuilder tb, string eventName, EventAttributes eventAttrs, Type eventType) {
                        name = eventName;
@@ -108,13 +110,11 @@ namespace System.Reflection.Emit {
                        if (customBuilder == null)
                                throw new ArgumentNullException ("customBuilder");
                        RejectIfCreated ();
-#if NET_2_0
                        string attrname = customBuilder.Ctor.ReflectedType.FullName;
                        if (attrname == "System.Runtime.CompilerServices.SpecialNameAttribute") {
                                attrs |= EventAttributes.SpecialName;
                                return;
                        }
-#endif
                        if (cattrs != null) {
                                CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
                                cattrs.CopyTo (new_array, 0);
@@ -126,9 +126,7 @@ namespace System.Reflection.Emit {
                        }
                }
 
-#if NET_2_0
                [ComVisible (true)]
-#endif
                public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
                        if (con == null)
                                throw new ArgumentNullException ("con");
@@ -164,3 +162,4 @@ namespace System.Reflection.Emit {
        }
 }
 
+#endif