[Serializable]
[ClassInterface (ClassInterfaceType.None)]
- public abstract class Type : MemberInfo, IReflect {
+#if NET_2_0
+ [ComVisible (true)]
+ [ComDefaultInterface (typeof (_Type))]
+#endif
+ public abstract class Type : MemberInfo, IReflect, _Type, _MemberInfo {
internal RuntimeTypeHandle _impl;
public static readonly MemberFilter FilterNameIgnoreCase = new MemberFilter (FilterNameIgnoreCase_impl);
public static readonly object Missing;
- protected const BindingFlags DefaultBindingFlags =
+ internal const BindingFlags DefaultBindingFlags =
BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
/* implementation of the delegates for MemberFilter */
public abstract RuntimeTypeHandle TypeHandle {get;}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo TypeInitializer {
get {
return GetConstructorImpl (
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static TypeCode GetTypeCodeInternal (Type type);
+ internal extern static TypeCode GetTypeCodeInternal (Type type);
public static TypeCode GetTypeCode (Type type) {
type = type.UnderlyingSystemType;
return type_is_subtype_of (a, b, check_interfaces);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual bool IsSubclassOf (Type c)
{
if (c == null)
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void GetInterfaceMapData (Type t, Type iface, out MethodInfo[] targets, out MethodInfo[] methods);
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public virtual InterfaceMapping GetInterfaceMap (Type interfaceType) {
InterfaceMapping res;
if (interfaceType == null)
return GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
}
+ internal virtual MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+ {
+ throw new System.InvalidOperationException ("can only be called in generic type");
+ }
+
+ internal virtual ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+ {
+ throw new System.InvalidOperationException ("can only be called in generic type");
+ }
+
+ internal virtual FieldInfo GetField (FieldInfo fromNoninstanciated)
+ {
+ throw new System.InvalidOperationException ("can only be called in generic type");
+ }
+
+
public MethodInfo[] GetMethods ()
{
return GetMethods (DefaultBindingFlags);
throw new ArgumentNullException ("name");
if (types == null)
throw new ArgumentNullException ("types");
-
- foreach (Type t in types)
- if (t == null)
- throw new ArgumentNullException ("types");
-
+
return GetPropertyImpl (name, bindingAttr, binder, returnType, types, modifiers);
}
return typeof (MarshalByRefObject).IsAssignableFrom (this);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo GetConstructor (Type[] types)
{
- return GetConstructor (DefaultBindingFlags, null, CallingConventions.Any, types, null);
+ return GetConstructorImpl (
+ DefaultBindingFlags, null, CallingConventions.Any, types, null);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder,
Type[] types, ParameterModifier[] modifiers)
{
- return GetConstructor (bindingAttr, binder, CallingConventions.Any, types, modifiers);
+ return GetConstructorImpl (
+ bindingAttr, binder, CallingConventions.Any, types, modifiers);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder,
CallingConventions callConvention,
Type[] types, ParameterModifier[] modifiers)
{
if (types == null)
throw new ArgumentNullException ("types");
-
- foreach (Type t in types)
- if (t == null)
- throw new ArgumentNullException ("types");
return GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
}
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public ConstructorInfo[] GetConstructors ()
{
return GetConstructors (BindingFlags.Public | BindingFlags.Instance);
}
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public abstract ConstructorInfo[] GetConstructors (BindingFlags bindingAttr);
public virtual MemberInfo[] GetDefaultMembers ()
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static extern Type BindGenericParameters (Type gt, Type [] types);
-
+
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public Type BindGenericParameters (Type [] types)
{
if (types == null)
return res;
}
+ public Type MakeGenericType (Type[] types)
+ {
+ return BindGenericParameters (types);
+ }
+
public abstract bool IsGenericParameter {
get;
}
return attr;
}
}
+
+ internal object[] GetPseudoCustomAttributes () {
+ int count = 0;
+
+ if (IsSerializable)
+ count ++;
+
+ if (count == 0)
+ return null;
+ object[] attrs = new object [count];
+ count = 0;
+
+ if (IsSerializable)
+ attrs [count ++] = new SerializableAttribute ();
+
+ return attrs;
+ }
+
#endif
}
}