| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- //
- // System.Reflection/Assembly.cs
- //
- // Author:
- // Paolo Molaro ([email protected])
- //
- // (C) 2001 Ximian, Inc. http://www.ximian.com
- //
- using System;
- using System.Security.Policy;
- using System.Runtime.Serialization;
- using System.Reflection.Emit;
- using System.IO;
- using System.Globalization;
- using System.Runtime.CompilerServices;
- namespace System.Reflection {
- [Serializable]
- public class Assembly : System.Reflection.ICustomAttributeProvider,
- System.Security.IEvidenceFactory, System.Runtime.Serialization.ISerializable {
- private IntPtr _mono_assembly;
- internal Assembly () {}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern string get_code_base ();
-
- public virtual string CodeBase {
- get {
- return get_code_base ();
- }
- }
- internal virtual string CopiedCodeBase {
- get {
- return null;
- }
- }
- public virtual string FullName {
- get {
- //
- // FIXME: This is wrong, but it gets us going
- // in the compiler for now
- //
- return CodeBase;
- }
- }
- public virtual MethodInfo EntryPoint {
- get {
- return null;
- }
- }
- public virtual Evidence Evidence {
- get {
- return null;
- }
- }
- public virtual String Location {
- get {
- return null;
- }
- }
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- }
- public virtual bool IsDefined (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
- public virtual object [] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
- public virtual FileStream[] GetFiles ()
- {
- throw new NotImplementedException ();
- }
- public virtual FileStream GetFile (String name)
- {
- throw new NotImplementedException ();
- }
- public virtual Stream GetManifestResourceStream (String name)
- {
- throw new NotImplementedException ();
- }
- public virtual Stream GetManifestResourceStream (Type type, String name)
- {
- throw new NotImplementedException ();
- }
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern Type[] GetTypes (bool exportedOnly);
-
- public virtual Type[] GetTypes ()
- {
- return GetTypes (false);
- }
- public virtual Type[] GetExportedTypes ()
- {
- return GetTypes (true);
- }
- public virtual Type GetType (String name, Boolean throwOnError)
- {
- return GetType (name, throwOnError, false);
- }
- public virtual Type GetType (String name) {
- return GetType (name, false, false);
- }
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern Type GetType (String name, Boolean throwOnError, Boolean ignoreCase);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- static extern void FillName (Assembly ass, AssemblyName aname);
-
- public virtual AssemblyName GetName (Boolean copiedName)
- {
- AssemblyName aname = new AssemblyName ();
- FillName (this, aname);
- return aname;
- }
- public virtual AssemblyName GetName ()
- {
- return GetName (false);
- }
- public override String ToString ()
- {
- return GetName ().Name;
- }
- [MonoTODO]
- public static String CreateQualifiedName (String assemblyName, String typeName)
- {
- return typeName + "," + assemblyName;
- }
- public static Assembly GetAssembly (Type type)
- {
- if (type != null)
- return type.Assembly;
- throw new ArgumentNullException ("type");
- }
- [MonoTODO]
- public Assembly GetSatelliteAssembly (CultureInfo culture)
- {
- throw new NotImplementedException ();
- }
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static Assembly LoadFrom (String assemblyFile);
- public static Assembly Load (String assemblyString)
- {
- return AppDomain.CurrentDomain.Load (assemblyString);
- }
-
- public static Assembly Load (String assemblyString, Evidence assemblySecurity)
- {
- return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
- }
- public static Assembly Load (AssemblyName assemblyRef)
- {
- return AppDomain.CurrentDomain.Load (assemblyRef);
- }
- public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
- {
- return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
- }
- public static Assembly Load (Byte[] rawAssembly)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly);
- }
- public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
- }
- public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
- Evidence securityEvidence)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
- }
- public static Assembly LoadWithPartialName (string partialName)
- {
- return LoadWithPartialName (partialName, null);
- }
- [MonoTODO]
- public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
- {
- return AppDomain.CurrentDomain.Load (partialName, securityEvidence);
- }
- public Object CreateInstance (String typeName)
- {
- throw new NotImplementedException ();
- }
- public Object CreateInstance (String typeName, Boolean ignoreCase)
- {
- throw new NotImplementedException ();
- }
- public Object CreateInstance (String typeName, Boolean ignoreCase,
- BindingFlags bindingAttr, Binder binder,
- Object[] args, CultureInfo culture,
- Object[] activationAttributes)
- {
- throw new NotImplementedException ();
- }
- public Module[] GetLoadedModules ()
- {
- throw new NotImplementedException ();
- }
- public Module[] GetModules ()
- {
- throw new NotImplementedException ();
- }
- public Module GetModule (String name)
- {
- throw new NotImplementedException ();
- }
- public virtual String[] GetManifestResourceNames ()
- {
- throw new NotImplementedException ();
- }
- public static Assembly GetExecutingAssembly ()
- {
- throw new NotImplementedException ();
- }
- public AssemblyName[] GetReferencedAssemblies ()
- {
- throw new NotImplementedException ();
- }
- public virtual ManifestResourceInfo GetManifestResourceInfo (String resourceName)
- {
- throw new NotImplementedException ();
- }
- }
- }
|