Mon Feb 11 19:50:27 CET 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection / Assembly.cs
1 //
2 // System.Reflection/Assembly.cs
3 //
4 // Author:
5 //   Paolo Molaro (lupus@ximian.com)
6 //
7 // (C) 2001 Ximian, Inc.  http://www.ximian.com
8 //
9
10 using System;
11 using System.Security.Policy;
12 using System.Runtime.Serialization;
13 using System.Reflection.Emit;
14 using System.IO;
15 using System.Globalization;
16 using System.Runtime.CompilerServices;
17
18 namespace System.Reflection {
19
20         public class Assembly : System.Reflection.ICustomAttributeProvider,
21                 System.Security.IEvidenceFactory, System.Runtime.Serialization.ISerializable {
22                 private IntPtr _mono_assembly;
23
24                 [MethodImplAttribute (MethodImplOptions.InternalCall)]
25                 private extern string get_code_base ();
26                 
27                 public virtual string CodeBase {
28                         get {
29                                 return get_code_base ();
30                         }
31                 }
32
33                 public virtual string CopiedCodeBase {
34                         get {
35                                 return null;
36                         }
37                 } 
38
39                 public virtual string FullName {
40                         get {
41                                 //
42                                 // FIXME: This is wrong, but it gets us going
43                                 // in the compiler for now
44                                 //
45                                 return CodeBase;
46                         }
47                 }
48
49                 public virtual MethodInfo EntryPoint {
50                         get {
51                                 return null;
52                         }
53                 }
54
55                 public virtual Evidence Evidence {
56                         get {
57                                 return null;
58                         }
59                 }
60
61                 public virtual String Location {
62                         get {
63                                 return null;
64                         }
65                 }
66
67                 public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
68                 {
69                 }
70
71                 public virtual Boolean IsDefined (Type attributeType)
72                 {
73                         return false;
74                 }
75
76                 public virtual bool IsDefined (Type attribute_type, bool inherit)
77                 {
78                         return false;
79                 }
80
81                 public virtual Object[] GetCustomAttributes ()
82                 {
83                         return null;
84                 }
85
86                 public virtual Object[] GetCustomAttributes (Type attributeType)
87                 {
88                         return null;
89                 }
90                 
91                 public virtual object [] GetCustomAttributes (bool inherit)
92                 {
93                         return null;
94                 }
95
96                 public virtual object [] GetCustomAttributes (Type attribute_type, bool inherit)
97                 {
98                         return null;
99                 }
100
101                 public virtual void RemoveOnTypeResolve (ResolveEventHandler handler)
102                 {
103                         throw new NotImplementedException ();
104                 }
105
106                 public virtual void AddOnTypeResolve (ResolveEventHandler handler)
107                 {
108                         throw new NotImplementedException ();
109                 }
110
111                 public virtual void RemoveOnResourceResolve (ResolveEventHandler handler)
112                 {
113                         throw new NotImplementedException ();
114                 }
115                 
116                 public virtual void AddOnResourceResolve (ResolveEventHandler handler)
117                 {
118                         throw new NotImplementedException ();
119                 }
120
121                 public virtual ModuleBuilder DefineDynamicModule (String name, Boolean emitSymbolInfo)
122                 {
123                         throw new NotImplementedException ();
124                 }
125
126                 public virtual ModuleBuilder DefineDynamicModule (String name)
127                 {
128                         throw new NotImplementedException ();
129                 }
130
131                 public virtual FileStream[] GetFiles ()
132                 {
133                         throw new NotImplementedException ();
134                 }
135
136                 public virtual FileStream GetFile (String name)
137                 {
138                         throw new NotImplementedException ();
139                 }
140
141                 public virtual Stream GetManifestResourceStream (String name)
142                 {
143                         throw new NotImplementedException ();
144                 }
145
146                 public virtual Stream GetManifestResourceStream (Type type, String name)
147                 {
148                         throw new NotImplementedException ();
149                 }
150
151                 public virtual Type[] GetTypes ()
152                 {
153                         throw new NotImplementedException ();
154                 }
155
156                 public virtual Type[] GetExportedTypes ()
157                 {
158                         throw new NotImplementedException ();
159                 }
160
161                 public virtual Type GetType (String name, Boolean throwOnError)
162                 {
163                         return GetType (name, throwOnError, false);
164                 }
165
166                 public virtual Type GetType (String name) {
167                         return GetType (name, false, false);
168                 }
169
170                 [MethodImplAttribute (MethodImplOptions.InternalCall)]
171                 public extern Type GetType (String name, Boolean throwOnError, Boolean ignoreCase);
172                 
173                 public virtual AssemblyName GetName (Boolean copiedName)
174                 {
175                         throw new NotImplementedException ();
176                 }
177
178                 public virtual AssemblyName GetName ()
179                 {
180                         throw new NotImplementedException ();
181                 }
182
183                 public override String ToString ()
184                 {
185                         return GetName ().Name;
186                 }
187
188                 [MonoTODO]
189                 public static String CreateQualifiedName (String assemblyName, String typeName) 
190                 {
191                         return "FIXME: assembly";
192                 }
193
194                 [MonoTODO]
195                 public static String nCreateQualifiedName (String assemblyName, String typeName)
196                 {
197                         return "FIXME: assembly";
198                 }
199
200                 [MonoTODO]
201                 public static Assembly GetAssembly (Type type)
202                 {
203                         throw new NotImplementedException ();
204                 }
205
206                 [MonoTODO]
207                 public Assembly GetSatelliteAssembly (CultureInfo culture)
208                 {
209                         throw new NotImplementedException ();
210                 }
211
212                 public static Assembly LoadFrom (String assemblyFile)
213                 {
214                         return AppDomain.CurrentDomain.Load (assemblyFile);
215                 }
216
217                 public static Assembly Load (String assemblyString)
218                 {
219                         return AppDomain.CurrentDomain.Load (assemblyString);
220                 }
221                 
222                 public static Assembly Load (String assemblyString, Evidence assemblySecurity)
223                 {
224                         return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
225                 }
226
227                 public static Assembly Load (AssemblyName assemblyRef)
228                 {
229                         return AppDomain.CurrentDomain.Load (assemblyRef);
230                 }
231
232                 public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
233                 {
234                         return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
235                 }
236
237                 public static Assembly Load (Byte[] rawAssembly)
238                 {
239                         return AppDomain.CurrentDomain.Load (rawAssembly);
240                 }
241
242                 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
243                 {
244                         return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
245                 }
246
247                 public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
248                                              Evidence securityEvidence)
249                 {
250                         return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
251                 }
252
253                 public Object CreateInstance (String typeName) 
254                 {
255                         throw new NotImplementedException ();
256                 }
257
258                 public Object CreateInstance (String typeName, Boolean ignoreCase)
259                 {
260                         throw new NotImplementedException ();
261                 }
262
263                 public Object CreateInstance (String typeName, Boolean ignoreCase,
264                                               BindingFlags bindingAttr, Binder binder,
265                                               Object[] args, CultureInfo culture,
266                                               Object[] activationAttributes)
267                 {
268                         throw new NotImplementedException ();
269                 }
270
271                 public Module[] GetLoadedModules ()
272                 {
273                         throw new NotImplementedException ();
274                 }
275
276                 public Module[] GetModules ()
277                 {
278                         throw new NotImplementedException ();
279                 }
280
281                 public Module GetModule (String name)
282                 {
283                         throw new NotImplementedException ();
284                 }
285
286                 public String[] GetManifestResourceNames ()
287                 {
288                         throw new NotImplementedException ();
289                 }
290
291                 public static Assembly GetExecutingAssembly ()
292                 {
293                         throw new NotImplementedException ();
294                 }
295
296                 public AssemblyName[] GetReferencedAssemblies ()
297                 {
298                         throw new NotImplementedException ();
299                 }
300
301                 public ManifestResourceInfo GetManifestResourceInfo (String resourceName)
302                 {
303                         throw new NotImplementedException ();
304                 }
305
306                 public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity,
307                                              String callerLocation)
308                 {
309                         throw new NotImplementedException ();
310                 }
311
312                 public static Assembly Load (String assemblyString, Evidence assemblySecurity,
313                                              String callerLocation)
314                 {
315                         throw new NotImplementedException ();
316                 }
317
318         }
319 }