-2009-07-24 Rodrigo Kumpera <rkumpera@novell.com>
-
- * EventBuilder.cs: Make some fields internal.
-
- * TypeBuilder.cs: Make events field internal.
- Remove some MonoTODOs that are already done.
-
2009-07-24 Rodrigo Kumpera <rkumpera@novell.com>
* TypeBuilder.cs: Make the interfaces field internal.
[ClassInterface (ClassInterfaceType.None)]
public sealed class EventBuilder : _EventBuilder {
#pragma warning disable 169, 414
- internal string name;
+ string name;
Type type;
TypeBuilder typeb;
CustomAttributeBuilder[] cattrs;
- internal MethodBuilder add_method;
- internal MethodBuilder remove_method;
- internal MethodBuilder raise_method;
- internal MethodBuilder[] other_methods;
- internal EventAttributes attrs;
+ MethodBuilder add_method;
+ MethodBuilder remove_method;
+ MethodBuilder raise_method;
+ MethodBuilder[] other_methods;
+ EventAttributes attrs;
int table_idx;
#pragma warning restore 169, 414
internal PropertyBuilder[] properties;
internal int num_fields;
internal FieldBuilder[] fields;
- internal EventBuilder[] events;
+ private EventBuilder[] events;
private CustomAttributeBuilder[] cattrs;
internal TypeBuilder[] subtypes;
internal TypeAttributes attrs;
return new ArrayType (this, rank);
}
+ [MonoTODO]
public override Type MakeByRefType ()
{
return new ByRefType (this);
return base.MakeGenericType (typeArguments);
}
+ [MonoTODO]
public override Type MakePointerType ()
{
return new PointerType (this);
-2009-07-24 Rodrigo Kumpera <rkumpera@novell.com>
-
- * MonoGenericClass.cs (initialize): Remember the number
- of events available at initialization time. This is required as
- mcs expect this behavior under compiler context that new events
- are not returned for an instance that was inflated before.
-
- * MonoGenericClass.cs: Kill GetEvents_internal and implement it
- in terms of managed code.
-
2009-07-24 Rodrigo Kumpera <rkumpera@novell.com>
* MonoGenericClass.cs (GetParentType): Implement using managed code.
#endregion
Hashtable fields, ctors, methods;
- int event_count;
internal MonoGenericClass ()
: base (null)
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern MethodInfo GetCorrespondingInflatedMethod (MethodInfo generic);
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern EventInfo[] GetEvents_internal (Type reflected_type);
private const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;
if (parent != null)
parent.initialize ();
- EventInfo[] events = generic_type.GetEvents_internal (flags);
- event_count = events.Length;
-
initialize (generic_type.GetMethods (flags),
generic_type.GetConstructors (flags),
generic_type.GetFields (flags),
generic_type.GetProperties (flags),
- events);
+ generic_type.GetEvents_internal (flags));
initialized = true;
}
do {
MonoGenericClass gi = current_type as MonoGenericClass;
if (gi != null)
- l.AddRange (gi.GetEventsInternal (bf, this));
+ l.AddRange (gi.GetEvents_impl (bf, this));
else if (current_type is TypeBuilder)
l.AddRange (current_type.GetEvents (bf));
else {
l.CopyTo (result);
return result;
}
-
- EventInfo[] GetEventsInternal (BindingFlags bf, MonoGenericClass reftype) {
- if (generic_type.events == null)
- return new EventInfo [0];
-
- initialize ();
+ protected EventInfo[] GetEvents_impl (BindingFlags bf, Type reftype)
+ {
ArrayList l = new ArrayList ();
bool match;
MethodAttributes mattrs;
MethodInfo accessor;
- for (int i = 0; i < event_count; ++i) {
- EventBuilder ev = generic_type.events [i];
+ initialize ();
+
+ EventInfo[] events = GetEvents_internal (reftype);
+
+ for (int i = 0; i < events.Length; i++) {
+ EventInfo c = events [i];
match = false;
- accessor = ev.add_method;
+ accessor = c.GetAddMethod (true);
if (accessor == null)
- accessor = ev.remove_method;
+ accessor = c.GetRemoveMethod (true);
if (accessor == null)
continue;
mattrs = accessor.Attributes;
}
if (!match)
continue;
- l.Add (new EventOnTypeBuilderInst (reftype, ev));
+ l.Add (c);
}
EventInfo[] result = new EventInfo [l.Count];
l.CopyTo (result);
System.Reflection.Emit/DynamicMethod.cs
System.Reflection.Emit/EnumBuilder.cs
System.Reflection.Emit/EventBuilder.cs
-System.Reflection.Emit/EventOnTypeBuilderInst.cs
System.Reflection.Emit/EventToken.cs
System.Reflection.Emit/FieldBuilder.cs
System.Reflection.Emit/FieldOnTypeBuilderInst.cs