Wed Nov 14 16:30:27 CET 2001 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System / Type.cs
1 //
2 // System.Type.cs
3 //
4 // Author:
5 //   Miguel de Icaza (miguel@ximian.com)
6 //
7 // (C) Ximian, Inc.  http://www.ximian.com
8 //
9 // TODO: Mucho left to implement.
10 //
11
12 using System.Reflection;
13 using System.Runtime.CompilerServices;
14
15 namespace System {
16
17         //
18         // FIXME: Implement the various IReflect dependencies
19         //
20         
21         public abstract class Type : MemberInfo /* IReflect */ {
22                 
23                 internal RuntimeTypeHandle _impl;
24
25                 /// <summary>
26                 ///   The assembly where the type is defined.
27                 /// </summary>
28                 public abstract Assembly Assembly {
29                         get;
30                 }
31
32                 /// <summary>
33                 ///   Gets the fully qualified name for the type including the
34                 ///   assembly name where the type is defined.
35                 /// </summary>
36                 public abstract string AssemblyQualifiedName {
37                         get;
38                 }
39
40                 /// <summary>
41                 ///   Returns the Attributes associated with the type.
42                 /// </summary>
43                 public TypeAttributes Attributes {
44                         get {
45                                 // FIXME: Implement me.
46                                 return 0;
47                         }
48                 }
49                 
50                 /// <summary>
51                 ///   Returns the basetype for this type
52                 /// </summary>
53                 public abstract Type BaseType {
54                         get;
55                 }
56                         
57                 /// <summary>
58                 ///   Returns the class that declares the member.
59                 /// </summary>
60                 public override Type DeclaringType {
61                         get {
62                                 // FIXME: Implement me.
63                                 return null;
64                         }
65                 }
66                 
67                 /// <summary>
68                 ///
69                 /// </summary>
70                 // public static Binder DefaultBinder {
71                 // get;
72                 // }
73                 
74                 /// <summary>
75                 ///
76                 /// </summary>
77                 
78                 /// <summary>
79                 ///
80                 /// </summary>
81                 /// <summary>
82                 ///
83                 /// </summary>
84
85                 /// <summary>
86                 ///    The full name of the type including its namespace
87                 /// </summary>
88                 public abstract string FullName {
89                         get;
90                 }
91
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);
96                 
97                 public static Type GetType(string typeName)
98                 {
99                         return internal_from_name (typeName);
100                 }
101
102                 public static Type GetType(string typeName, bool throwOnError)
103                 {
104                         // LAMESPEC: what kinds of errors cause exception to be thrown?
105                         return internal_from_name (typeName);
106                 }
107
108                 public static Type GetTypeFromHandle (RuntimeTypeHandle handle)
109                 { 
110                         return internal_from_handle (handle);
111                 }
112
113                 public abstract RuntimeTypeHandle TypeHandle { get; }
114                 
115                 public bool IsValueType {
116                         get {
117                                 // FIXME
118                                 return(false);
119                         }
120                 }
121
122                 public bool IsClass {
123                         get {
124                                 // FIXME
125                                 return true;
126                         }
127                 }
128
129                 public bool IsInterface {
130                         get {
131                                 // FIXME
132                                 return false;
133                         }
134                 }
135
136                 public bool IsArray {
137                         get {
138                                 // FIXME
139                                 return false;
140                         }
141                 }
142
143                 public bool IsSubclassOf (Type c)
144                 {
145                         // FIXME
146                         return false;
147                 }
148
149                 public virtual Type[] FindInterfaces (TypeFilter filter, object filterCriteria)
150                 {
151                         // FIXME
152                         return null;
153                 }
154
155                 public abstract Type[] GetInterfaces ();
156                 
157                 public virtual bool IsAssignableFrom (Type c)
158                 {
159                         // FIXME
160                         return true;
161                 }
162
163                 public virtual int GetArrayRank ()
164                 {
165                         // FIXME
166                         return 0;
167                 }
168
169                 public abstract Type GetElementType ();
170
171                 public bool IsSealed {
172                         get {
173                                 // FIXME
174                                 return false;
175                         }
176                 }
177
178                 public bool IsAbstract {
179                         get {
180                                 // FIXME
181                                 return false;
182                         }
183                 }
184
185                 public bool IsContextful {
186                         get {
187                                 return typeof (ContextBoundObject).IsAssignableFrom (this);
188                         }
189                 }
190
191                 public bool IsNotPublic {
192                         get {
193                                 // FIXME
194                                 return false;
195                         }
196                 }
197
198                 public bool IsPublic {
199                         get {
200                                 // FIXME
201                                 return false;
202                         }
203                 }
204
205                 public abstract Module Module {get;}
206                 public abstract string Namespace {get;}
207
208                 public MethodInfo[] GetMethods ()
209                 {
210                         // FIXME
211                         return null;
212                 }
213
214                 public MethodInfo[] GetMethods (BindingFlags bindingAttr)
215                 {
216                         // FIXME
217                         return null;
218                 }
219
220                 public PropertyInfo GetProperty (string name, Type[] types)
221                 {
222                         // FIXME
223                         return null;
224                 }
225
226                 public ConstructorInfo GetConstructor (Type[] types)
227                 {
228                         // FIXME
229                         return null;
230                 }
231
232                 public MethodInfo GetMethod (string name, Type[] types)
233                 {
234                         // FIXME
235                         return null;
236                 }
237
238                 public virtual MemberInfo[] FindMembers( MemberTypes memberType, BindingFlags bindingAttr, MemberFilter filter, object filterCriteria) {
239                         return null;
240                 }
241
242                 public static TypeCode GetTypeCode( Type type) {
243                         return TypeCode.Empty;
244                 }
245
246                 public override string ToString() {
247                         return null;
248                 }
249
250         }
251 }