namespace System.Reflection.Emit {
#if NET_2_0
[ComVisible (true)]
- [ClassInterfaceAttribute (ClassInterfaceType.None)]
- [ComDefaultInterfaceAttribute (typeof (_TypeBuilder))]
+ [ComDefaultInterface (typeof (_TypeBuilder))]
#endif
- public sealed class TypeBuilder : Type {
+ [ClassInterface (ClassInterfaceType.None)]
+ public sealed class TypeBuilder : Type, _TypeBuilder {
#region Sync with reflection.h
private string tname;
private string nspace;
nativeCallConv, nativeCharSet);
}
-#if NET_2_0
+#if NET_2_0 || BOOTSTRAP_NET_2_0
public MethodBuilder DefineMethod (string name, MethodAttributes attributes) {
return DefineMethod (name, attributes, CallingConventions.Standard);
}
if (created != null)
return created;
+ create_generic_class ();
+
// Fire TypeResolve events for fields whose type is an unfinished
// value type.
if (fields != null) {
}
}
+ if ((parent != null) && parent.IsSealed)
+ throw new TypeLoadException ("Could not load type '" + FullName + "' from assembly '" + Assembly + "' because the parent type is sealed.");
+
if (methods != null) {
for (int i = 0; i < num_methods; ++i)
((MethodBuilder)(methods[i])).fixup ();
}
else
candidates = methods;
-
+
if (candidates == null)
return new MethodInfo [0];
}
}
return;
+#if NET_2_0
+ } else if (attrname == "System.Runtime.CompilerServices.SpecialNameAttribute") {
+ attrs |= TypeAttributes.SpecialName;
+ return;
+#endif
} else if (attrname == "System.SerializableAttribute") {
attrs |= TypeAttributes.Serializable;
return;
+ } else if (attrname == "System.Runtime.InteropServices.ComImportAttribute") {
+ attrs |= TypeAttributes.Import;
+ return;
}
+
if (cattrs != null) {
CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
cattrs.CopyTo (new_array, 0);
return base.GetGenericTypeDefinition ();
}
- public override bool HasGenericArguments {
+ public override bool ContainsGenericParameters {
get {
return generic_params != null;
}
}
- public override bool ContainsGenericParameters {
+ public extern override bool IsGenericParameter {
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ get;
+ }
+
+ public override bool IsGenericTypeDefinition {
get {
return generic_params != null;
}
}
- public extern override bool IsGenericParameter {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- get;
+ public override bool IsGenericType {
+ get { return IsGenericTypeDefinition; }
}
public override int GenericParameterPosition {
}
}
- public override MethodInfo DeclaringMethod {
+ public override MethodBase DeclaringMethod {
get {
throw new NotImplementedException ();
}
return generic_params;
}
- public MethodBuilder DefineGenericMethod (string name, MethodAttributes attributes)
- {
- return DefineMethod (name, attributes, CallingConventions.Standard, null, null);
- }
-
public static ConstructorInfo GetConstructor (Type instanciated, ConstructorInfo ctor)
{
ConstructorInfo res = instanciated.GetConstructor (ctor);
return res;
}
#endif
+
+ void _TypeBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _TypeBuilder.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _TypeBuilder.GetTypeInfoCount (out uint pcTInfo)
+ {
+ throw new NotImplementedException ();
+ }
+
+ void _TypeBuilder.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
+ {
+ throw new NotImplementedException ();
+ }
}
}