Assembly.cs 6.8 KB

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