5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
9 // TODO: Mucho left to implement.
12 using System.Reflection;
13 using System.Runtime.CompilerServices;
18 // FIXME: Implement the various IReflect dependencies
21 public abstract class Type : MemberInfo /* IReflect */ {
23 internal RuntimeTypeHandle _impl;
26 /// The assembly where the type is defined.
28 public abstract Assembly Assembly {
33 /// Gets the fully qualified name for the type including the
34 /// assembly name where the type is defined.
36 public abstract string AssemblyQualifiedName {
41 /// Returns the Attributes associated with the type.
43 public TypeAttributes Attributes {
45 // FIXME: Implement me.
51 /// Returns the basetype for this type
53 public abstract Type BaseType {
58 /// Returns the class that declares the member.
60 public override Type DeclaringType {
62 // FIXME: Implement me.
70 // public static Binder DefaultBinder {
86 /// The full name of the type including its namespace
88 public abstract string FullName {
92 [MethodImplAttribute(MethodImplOptions.InternalCall)]
93 private static extern Type internal_from_handle (RuntimeTypeHandle handle);
94 [MethodImplAttribute(MethodImplOptions.InternalCall)]
95 private static extern Type internal_from_name (string name);
97 public static Type GetType(string typeName)
99 return internal_from_name (typeName);
102 public static Type GetType(string typeName, bool throwOnError)
104 // LAMESPEC: what kinds of errors cause exception to be thrown?
105 return internal_from_name (typeName);
108 public static Type GetTypeFromHandle (RuntimeTypeHandle handle)
110 return internal_from_handle (handle);
113 public abstract RuntimeTypeHandle TypeHandle { get; }
115 public bool IsValueType {
122 public bool IsClass {
129 public bool IsInterface {
136 public bool IsArray {
143 public bool IsSubclassOf (Type c)
149 public virtual Type[] FindInterfaces (TypeFilter filter, object filterCriteria)
155 public abstract Type[] GetInterfaces ();
157 public virtual bool IsAssignableFrom (Type c)
163 public virtual int GetArrayRank ()
169 public abstract Type GetElementType ();
171 public bool IsSealed {
178 public bool IsAbstract {
185 public bool IsContextful {
187 return typeof (ContextBoundObject).IsAssignableFrom (this);
191 public bool IsNotPublic {
198 public bool IsPublic {
205 public abstract Module Module {get;}
206 public abstract string Namespace {get;}
208 public MethodInfo[] GetMethods ()
214 public MethodInfo[] GetMethods (BindingFlags bindingAttr)
220 public PropertyInfo GetProperty (string name, Type[] types)
226 public ConstructorInfo GetConstructor (Type[] types)
232 public MethodInfo GetMethod (string name, Type[] types)
238 public virtual MemberInfo[] FindMembers( MemberTypes memberType, BindingFlags bindingAttr, MemberFilter filter, object filterCriteria) {
242 public static TypeCode GetTypeCode( Type type) {
243 return TypeCode.Empty;
246 public override string ToString() {