Assembly.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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 bool IsDefined (Type attributeType, bool inherit)
  60. {
  61. return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
  62. }
  63. public virtual object [] GetCustomAttributes (bool inherit)
  64. {
  65. return MonoCustomAttrs.GetCustomAttributes (this, inherit);
  66. }
  67. public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
  68. {
  69. return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
  70. }
  71. public virtual void RemoveOnTypeResolve (ResolveEventHandler handler)
  72. {
  73. throw new NotImplementedException ();
  74. }
  75. public virtual void AddOnTypeResolve (ResolveEventHandler handler)
  76. {
  77. throw new NotImplementedException ();
  78. }
  79. public virtual void RemoveOnResourceResolve (ResolveEventHandler handler)
  80. {
  81. throw new NotImplementedException ();
  82. }
  83. public virtual void AddOnResourceResolve (ResolveEventHandler handler)
  84. {
  85. throw new NotImplementedException ();
  86. }
  87. public virtual ModuleBuilder DefineDynamicModule (String name, Boolean emitSymbolInfo)
  88. {
  89. throw new NotImplementedException ();
  90. }
  91. public virtual ModuleBuilder DefineDynamicModule (String name)
  92. {
  93. throw new NotImplementedException ();
  94. }
  95. public virtual FileStream[] GetFiles ()
  96. {
  97. throw new NotImplementedException ();
  98. }
  99. public virtual FileStream GetFile (String name)
  100. {
  101. throw new NotImplementedException ();
  102. }
  103. public virtual Stream GetManifestResourceStream (String name)
  104. {
  105. throw new NotImplementedException ();
  106. }
  107. public virtual Stream GetManifestResourceStream (Type type, String name)
  108. {
  109. throw new NotImplementedException ();
  110. }
  111. public virtual Type[] GetTypes ()
  112. {
  113. throw new NotImplementedException ();
  114. }
  115. public virtual Type[] GetExportedTypes ()
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. public virtual Type GetType (String name, Boolean throwOnError)
  120. {
  121. return GetType (name, throwOnError, false);
  122. }
  123. public virtual Type GetType (String name) {
  124. return GetType (name, false, false);
  125. }
  126. [MethodImplAttribute (MethodImplOptions.InternalCall)]
  127. public extern Type GetType (String name, Boolean throwOnError, Boolean ignoreCase);
  128. public virtual AssemblyName GetName (Boolean copiedName)
  129. {
  130. throw new NotImplementedException ();
  131. }
  132. public virtual AssemblyName GetName ()
  133. {
  134. throw new NotImplementedException ();
  135. }
  136. public override String ToString ()
  137. {
  138. return GetName ().Name;
  139. }
  140. [MonoTODO]
  141. public static String CreateQualifiedName (String assemblyName, String typeName)
  142. {
  143. return "FIXME: assembly";
  144. }
  145. [MonoTODO]
  146. public static String nCreateQualifiedName (String assemblyName, String typeName)
  147. {
  148. return "FIXME: assembly";
  149. }
  150. [MonoTODO]
  151. public static Assembly GetAssembly (Type type)
  152. {
  153. throw new NotImplementedException ();
  154. }
  155. [MonoTODO]
  156. public Assembly GetSatelliteAssembly (CultureInfo culture)
  157. {
  158. throw new NotImplementedException ();
  159. }
  160. public static Assembly LoadFrom (String assemblyFile)
  161. {
  162. return AppDomain.CurrentDomain.Load (assemblyFile);
  163. }
  164. public static Assembly Load (String assemblyString)
  165. {
  166. return AppDomain.CurrentDomain.Load (assemblyString);
  167. }
  168. public static Assembly Load (String assemblyString, Evidence assemblySecurity)
  169. {
  170. return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
  171. }
  172. public static Assembly Load (AssemblyName assemblyRef)
  173. {
  174. return AppDomain.CurrentDomain.Load (assemblyRef);
  175. }
  176. public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
  177. {
  178. return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
  179. }
  180. public static Assembly Load (Byte[] rawAssembly)
  181. {
  182. return AppDomain.CurrentDomain.Load (rawAssembly);
  183. }
  184. public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
  185. {
  186. return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
  187. }
  188. public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
  189. Evidence securityEvidence)
  190. {
  191. return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
  192. }
  193. public Object CreateInstance (String typeName)
  194. {
  195. throw new NotImplementedException ();
  196. }
  197. public Object CreateInstance (String typeName, Boolean ignoreCase)
  198. {
  199. throw new NotImplementedException ();
  200. }
  201. public Object CreateInstance (String typeName, Boolean ignoreCase,
  202. BindingFlags bindingAttr, Binder binder,
  203. Object[] args, CultureInfo culture,
  204. Object[] activationAttributes)
  205. {
  206. throw new NotImplementedException ();
  207. }
  208. public Module[] GetLoadedModules ()
  209. {
  210. throw new NotImplementedException ();
  211. }
  212. public Module[] GetModules ()
  213. {
  214. throw new NotImplementedException ();
  215. }
  216. public Module GetModule (String name)
  217. {
  218. throw new NotImplementedException ();
  219. }
  220. public String[] GetManifestResourceNames ()
  221. {
  222. throw new NotImplementedException ();
  223. }
  224. public static Assembly GetExecutingAssembly ()
  225. {
  226. throw new NotImplementedException ();
  227. }
  228. public AssemblyName[] GetReferencedAssemblies ()
  229. {
  230. throw new NotImplementedException ();
  231. }
  232. public ManifestResourceInfo GetManifestResourceInfo (String resourceName)
  233. {
  234. throw new NotImplementedException ();
  235. }
  236. public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity,
  237. String callerLocation)
  238. {
  239. throw new NotImplementedException ();
  240. }
  241. public static Assembly Load (String assemblyString, Evidence assemblySecurity,
  242. String callerLocation)
  243. {
  244. throw new NotImplementedException ();
  245. }
  246. }
  247. }