using System.Runtime.InteropServices;
namespace System.Reflection.Emit {
- public sealed class EventBuilder {
- string name;
+ [ComVisible (true)]
+ [ComDefaultInterface (typeof (_EventBuilder))]
+ [ClassInterface (ClassInterfaceType.None)]
+ public sealed class EventBuilder : _EventBuilder {
+#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;
if (customBuilder == null)
throw new ArgumentNullException ("customBuilder");
RejectIfCreated ();
+ string attrname = customBuilder.Ctor.ReflectedType.FullName;
+ if (attrname == "System.Runtime.CompilerServices.SpecialNameAttribute") {
+ attrs |= EventAttributes.SpecialName;
+ return;
+ }
if (cattrs != null) {
CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
cattrs.CopyTo (new_array, 0);
cattrs [0] = customBuilder;
}
}
+
+ [ComVisible (true)]
public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
if (con == null)
throw new ArgumentNullException ("con");
if (typeb.is_created)
throw new InvalidOperationException ("Type definition of the method is complete.");
}
+
+ void _EventBuilder.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _EventBuilder.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _EventBuilder.GetTypeInfoCount (out uint pcTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _EventBuilder.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
+ {
+ throw new NotImplementedException ();
+ }
}
}