Files
Dec2017-Script-Dump/mscorlib/System/Reflection/Assembly.cs
T
2026-06-04 11:42:34 +02:00

1595 lines
88 KiB
C#

using System;
using System.Collections;
using System.Configuration.Assemblies;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security;
using System.Security.Policy;
namespace System.Reflection
{
/// <summary>Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.</summary>
// Token: 0x0200021F RID: 543
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_Assembly))]
[ComVisible(true)]
[Serializable]
public class Assembly : ICustomAttributeProvider, _Assembly
{
// Token: 0x06001CF5 RID: 7413 RVA: 0x0006D4B4 File Offset: 0x0006B6B4
internal Assembly()
{
this.resolve_event_holder = new Assembly.ResolveEventHolder();
}
/// <summary>Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.</summary>
// Token: 0x14000004 RID: 4
// (add) Token: 0x06001CF6 RID: 7414 RVA: 0x0006D4C8 File Offset: 0x0006B6C8
// (remove) Token: 0x06001CF7 RID: 7415 RVA: 0x0006D4D8 File Offset: 0x0006B6D8
public event ModuleResolveEventHandler ModuleResolve
{
add
{
this.resolve_event_holder.ModuleResolve += value;
}
remove
{
this.resolve_event_holder.ModuleResolve -= value;
}
}
// Token: 0x06001CF8 RID: 7416
[MethodImpl(MethodImplOptions.InternalCall)]
private extern string get_code_base(bool escaped);
// Token: 0x06001CF9 RID: 7417
[MethodImpl(MethodImplOptions.InternalCall)]
private extern string get_fullname();
// Token: 0x06001CFA RID: 7418
[MethodImpl(MethodImplOptions.InternalCall)]
private extern string get_location();
// Token: 0x06001CFB RID: 7419
[MethodImpl(MethodImplOptions.InternalCall)]
private extern string InternalImageRuntimeVersion();
// Token: 0x06001CFC RID: 7420 RVA: 0x0006D4E8 File Offset: 0x0006B6E8
private string GetCodeBase(bool escaped)
{
return this.get_code_base(escaped);
}
/// <summary>Gets the location of the assembly as specified originally, for example, in an <see cref="T:System.Reflection.AssemblyName" /> object.</summary>
/// <returns>The location of the assembly as specified originally.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x17000532 RID: 1330
// (get) Token: 0x06001CFD RID: 7421 RVA: 0x0006D500 File Offset: 0x0006B700
public virtual string CodeBase
{
get
{
return this.GetCodeBase(false);
}
}
/// <summary>Gets the URI, including escape characters, that represents the codebase.</summary>
/// <returns>A URI with escape characters.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x17000533 RID: 1331
// (get) Token: 0x06001CFE RID: 7422 RVA: 0x0006D50C File Offset: 0x0006B70C
public virtual string EscapedCodeBase
{
get
{
return this.GetCodeBase(true);
}
}
/// <summary>Gets the display name of the assembly.</summary>
/// <returns>The display name of the assembly.</returns>
// Token: 0x17000534 RID: 1332
// (get) Token: 0x06001CFF RID: 7423 RVA: 0x0006D518 File Offset: 0x0006B718
public virtual string FullName
{
get
{
return this.ToString();
}
}
/// <summary>Gets the entry point of this assembly.</summary>
/// <returns>A <see cref="T:System.Reflection.MethodInfo" /> object that represents the entry point of this assembly. If no entry point is found (for example, the assembly is a DLL), null is returned.</returns>
// Token: 0x17000535 RID: 1333
// (get) Token: 0x06001D00 RID: 7424
public virtual extern MethodInfo EntryPoint
{
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
/// <summary>Gets the evidence for this assembly.</summary>
/// <returns>An Evidence object for this assembly.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x17000536 RID: 1334
// (get) Token: 0x06001D01 RID: 7425 RVA: 0x0006D520 File Offset: 0x0006B720
public virtual Evidence Evidence
{
get
{
return this.UnprotectedGetEvidence();
}
}
// Token: 0x06001D02 RID: 7426 RVA: 0x0006D528 File Offset: 0x0006B728
internal Evidence UnprotectedGetEvidence()
{
if (this._evidence == null)
{
lock (this)
{
this._evidence = Evidence.GetDefaultHostEvidence(this);
}
}
return this._evidence;
}
// Token: 0x06001D03 RID: 7427
[MethodImpl(MethodImplOptions.InternalCall)]
private extern bool get_global_assembly_cache();
/// <summary>Gets a value indicating whether the assembly was loaded from the global assembly cache.</summary>
/// <returns>true if the assembly was loaded from the global assembly cache; otherwise, false.</returns>
// Token: 0x17000537 RID: 1335
// (get) Token: 0x06001D04 RID: 7428 RVA: 0x0006D584 File Offset: 0x0006B784
public bool GlobalAssemblyCache
{
get
{
return this.get_global_assembly_cache();
}
}
// Token: 0x17000538 RID: 1336
// (set) Token: 0x06001D05 RID: 7429 RVA: 0x0006D58C File Offset: 0x0006B78C
internal bool FromByteArray
{
set
{
this.fromByteArray = value;
}
}
/// <summary>Gets the path or UNC location of the loaded file that contains the manifest.</summary>
/// <returns>The location of the loaded file that contains the manifest. If the loaded file was shadow-copied, the location is that of the file after being shadow-copied. If the assembly is loaded from a byte array, such as when using the <see cref="M:System.Reflection.Assembly.Load(System.Byte[])" /> method overload, the value returned is an empty string ("").</returns>
/// <exception cref="T:System.NotSupportedException">The current assembly is a dynamic assembly, represented by an <see cref="T:System.Reflection.Emit.AssemblyBuilder" /> object. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x17000539 RID: 1337
// (get) Token: 0x06001D06 RID: 7430 RVA: 0x0006D598 File Offset: 0x0006B798
public virtual string Location
{
get
{
if (this.fromByteArray)
{
return string.Empty;
}
return this.get_location();
}
}
/// <summary>Gets a string representing the version of the common language runtime (CLR) saved in the file containing the manifest.</summary>
/// <returns>A string representing the CLR version folder name. This is not a full path.</returns>
// Token: 0x1700053A RID: 1338
// (get) Token: 0x06001D07 RID: 7431 RVA: 0x0006D5C0 File Offset: 0x0006B7C0
[ComVisible(false)]
public virtual string ImageRuntimeVersion
{
get
{
return this.InternalImageRuntimeVersion();
}
}
/// <summary>Gets serialization information with all of the data needed to reinstantiate this assembly.</summary>
/// <param name="info">The object to be populated with serialization information. </param>
/// <param name="context">The destination context of the serialization. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="info" /> is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter" />
/// </PermissionSet>
// Token: 0x06001D08 RID: 7432 RVA: 0x0006D5C8 File Offset: 0x0006B7C8
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
UnitySerializationHolder.GetAssemblyData(this, info, context);
}
/// <summary>Indicates whether or not a specified attribute has been applied to the assembly.</summary>
/// <returns>true if the attribute has been applied to the assembly; otherwise, false.</returns>
/// <param name="attributeType">The <see cref="T:System.Type" /> of the attribute to be checked for this assembly. </param>
/// <param name="inherit">This argument is ignored for objects of this type. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="attributeType" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="attributeType" /> uses an invalid type.</exception>
// Token: 0x06001D09 RID: 7433 RVA: 0x0006D5E4 File Offset: 0x0006B7E4
public virtual bool IsDefined(Type attributeType, bool inherit)
{
return MonoCustomAttrs.IsDefined(this, attributeType, inherit);
}
/// <summary>Gets all the custom attributes for this assembly.</summary>
/// <returns>An array of type Object containing the custom attributes for this assembly.</returns>
/// <param name="inherit">This argument is ignored for objects of type <see cref="T:System.Reflection.Assembly" />. </param>
// Token: 0x06001D0A RID: 7434 RVA: 0x0006D5F0 File Offset: 0x0006B7F0
public virtual object[] GetCustomAttributes(bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes(this, inherit);
}
/// <summary>Gets the custom attributes for this assembly as specified by type.</summary>
/// <returns>An array of type Object containing the custom attributes for this assembly as specified by <paramref name="attributeType" />.</returns>
/// <param name="attributeType">The <see cref="T:System.Type" /> for which the custom attributes are to be returned. </param>
/// <param name="inherit">This argument is ignored for objects of type <see cref="T:System.Reflection.Assembly" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="attributeType" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="attributeType" /> is not a runtime type. </exception>
// Token: 0x06001D0B RID: 7435 RVA: 0x0006D5FC File Offset: 0x0006B7FC
public virtual object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes(this, attributeType, inherit);
}
// Token: 0x06001D0C RID: 7436
[MethodImpl(MethodImplOptions.InternalCall)]
private extern object GetFilesInternal(string name, bool getResourceModules);
/// <summary>Gets the files in the file table of an assembly manifest.</summary>
/// <returns>An array of <see cref="T:System.IO.FileStream" /> objects.</returns>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">A file was not found. </exception>
/// <exception cref="T:System.BadImageFormatException">A file was not a valid assembly. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001D0D RID: 7437 RVA: 0x0006D608 File Offset: 0x0006B808
public virtual FileStream[] GetFiles()
{
return this.GetFiles(false);
}
/// <summary>Gets the files in the file table of an assembly manifest, specifying whether to include resource modules.</summary>
/// <returns>An array of <see cref="T:System.IO.FileStream" /> objects.</returns>
/// <param name="getResourceModules">true to include resource modules; otherwise, false. </param>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">A file was not found. </exception>
/// <exception cref="T:System.BadImageFormatException">A file was not a valid assembly. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001D0E RID: 7438 RVA: 0x0006D614 File Offset: 0x0006B814
public virtual FileStream[] GetFiles(bool getResourceModules)
{
string[] array = (string[])this.GetFilesInternal(null, getResourceModules);
if (array == null)
{
return new FileStream[0];
}
string location = this.Location;
FileStream[] array2;
if (location != string.Empty)
{
array2 = new FileStream[array.Length + 1];
array2[0] = new FileStream(location, FileMode.Open, FileAccess.Read);
for (int i = 0; i < array.Length; i++)
{
array2[i + 1] = new FileStream(array[i], FileMode.Open, FileAccess.Read);
}
}
else
{
array2 = new FileStream[array.Length];
for (int j = 0; j < array.Length; j++)
{
array2[j] = new FileStream(array[j], FileMode.Open, FileAccess.Read);
}
}
return array2;
}
/// <summary>Gets a <see cref="T:System.IO.FileStream" /> for the specified file in the file table of the manifest of this assembly.</summary>
/// <returns>A <see cref="T:System.IO.FileStream" /> for the specified file, or null if the file is not found.</returns>
/// <param name="name">The name of the specified file. Do not include the path to the file.</param>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="name" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> was not found. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> is not a valid assembly. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001D0F RID: 7439 RVA: 0x0006D6C4 File Offset: 0x0006B8C4
public virtual FileStream GetFile(string name)
{
if (name == null)
{
throw new ArgumentNullException(null, "Name cannot be null.");
}
if (name.Length == 0)
{
throw new ArgumentException("Empty name is not valid");
}
string text = (string)this.GetFilesInternal(name, true);
if (text != null)
{
return new FileStream(text, FileMode.Open, FileAccess.Read);
}
return null;
}
// Token: 0x06001D10 RID: 7440
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern IntPtr GetManifestResourceInternal(string name, out int size, out Module module);
/// <summary>Loads the specified manifest resource from this assembly.</summary>
/// <returns>A <see cref="T:System.IO.Stream" /> representing the manifest resource; null if no resources were specified during compilation, or if the resource is not visible to the caller.</returns>
/// <param name="name">The case-sensitive name of the manifest resource being requested. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="name" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> was not found. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> is not a valid assembly. </exception>
// Token: 0x06001D11 RID: 7441 RVA: 0x0006D718 File Offset: 0x0006B918
public unsafe virtual Stream GetManifestResourceStream(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name.Length == 0)
{
throw new ArgumentException("String cannot have zero length.", "name");
}
ManifestResourceInfo manifestResourceInfo = this.GetManifestResourceInfo(name);
if (manifestResourceInfo == null)
{
return null;
}
if (manifestResourceInfo.ReferencedAssembly != null)
{
return manifestResourceInfo.ReferencedAssembly.GetManifestResourceStream(name);
}
if (manifestResourceInfo.FileName != null && manifestResourceInfo.ResourceLocation == (ResourceLocation)0)
{
if (this.fromByteArray)
{
throw new FileNotFoundException(manifestResourceInfo.FileName);
}
string directoryName = Path.GetDirectoryName(this.Location);
string text = Path.Combine(directoryName, manifestResourceInfo.FileName);
return new FileStream(text, FileMode.Open, FileAccess.Read);
}
else
{
int num;
Module module;
IntPtr manifestResourceInternal = this.GetManifestResourceInternal(name, out num, out module);
if (manifestResourceInternal == (IntPtr)0)
{
return null;
}
UnmanagedMemoryStream unmanagedMemoryStream = new UnmanagedMemoryStream((byte*)(void*)manifestResourceInternal, (long)num);
unmanagedMemoryStream.Closed += new Assembly.ResourceCloseHandler(module).OnClose;
return unmanagedMemoryStream;
}
}
/// <summary>Loads the specified manifest resource, scoped by the namespace of the specified type, from this assembly.</summary>
/// <returns>A <see cref="T:System.IO.Stream" /> representing the manifest resource; null if no resources were specified during compilation or if the resource is not visible to the caller.</returns>
/// <param name="type">The type whose namespace is used to scope the manifest resource name. </param>
/// <param name="name">The case-sensitive name of the manifest resource being requested. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="name" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> was not found. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> is not a valid assembly. </exception>
// Token: 0x06001D12 RID: 7442 RVA: 0x0006D814 File Offset: 0x0006BA14
public virtual Stream GetManifestResourceStream(Type type, string name)
{
string text;
if (type != null)
{
text = type.Namespace;
}
else
{
if (name == null)
{
throw new ArgumentNullException("type");
}
text = null;
}
if (text == null || text.Length == 0)
{
return this.GetManifestResourceStream(name);
}
return this.GetManifestResourceStream(text + "." + name);
}
// Token: 0x06001D13 RID: 7443
[MethodImpl(MethodImplOptions.InternalCall)]
internal virtual extern Type[] GetTypes(bool exportedOnly);
/// <summary>Gets the types defined in this assembly.</summary>
/// <returns>An array of type <see cref="T:System.Type" /> containing objects for all the types defined in this assembly.</returns>
/// <exception cref="T:System.Reflection.ReflectionTypeLoadException">The assembly contains one or more types that cannot be loaded. The array returned by the <see cref="P:System.Reflection.ReflectionTypeLoadException.Types" /> property of this exception contains a <see cref="T:System.Type" /> object for each type that was loaded and null for each type that could not be loaded, while the <see cref="P:System.Reflection.ReflectionTypeLoadException.LoaderExceptions" /> property contains an exception for each type that could not be loaded.</exception>
// Token: 0x06001D14 RID: 7444 RVA: 0x0006D874 File Offset: 0x0006BA74
public virtual Type[] GetTypes()
{
return this.GetTypes(false);
}
/// <summary>Gets the public types defined in this assembly that are visible outside the assembly.</summary>
/// <returns>An array of Type objects that represent the types defined in this assembly that are visible outside the assembly.</returns>
// Token: 0x06001D15 RID: 7445 RVA: 0x0006D880 File Offset: 0x0006BA80
public virtual Type[] GetExportedTypes()
{
return this.GetTypes(true);
}
/// <summary>Gets the <see cref="T:System.Type" /> object with the specified name in the assembly instance and optionally throws an exception if the type is not found.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the specified class.</returns>
/// <param name="name">The full name of the type. </param>
/// <param name="throwOnError">true to throw an exception if the type is not found; false to return null. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> is invalid.-or- The length of <paramref name="name" /> exceeds 1024 characters. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.TypeLoadException">
/// <paramref name="throwOnError" /> is true, and the type cannot be found.</exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> requires a dependent assembly that could not be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="name" /> requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and <paramref name="name" /> requires a dependent assembly that was not preloaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> requires a dependent assembly, but the file is not a valid assembly. -or-<paramref name="name" /> requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.</exception>
// Token: 0x06001D16 RID: 7446 RVA: 0x0006D88C File Offset: 0x0006BA8C
public virtual Type GetType(string name, bool throwOnError)
{
return this.GetType(name, throwOnError, false);
}
/// <summary>Gets the <see cref="T:System.Type" /> object with the specified name in the assembly instance.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the specified class, or null if the class is not found.</returns>
/// <param name="name">The full name of the type. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> is invalid. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> requires a dependent assembly that could not be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="name" /> requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and <paramref name="name" /> requires a dependent assembly that was not preloaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> requires a dependent assembly, but the file is not a valid assembly. -or-<paramref name="name" /> requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.</exception>
// Token: 0x06001D17 RID: 7447 RVA: 0x0006D898 File Offset: 0x0006BA98
public virtual Type GetType(string name)
{
return this.GetType(name, false, false);
}
// Token: 0x06001D18 RID: 7448
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern Type InternalGetType(Module module, string name, bool throwOnError, bool ignoreCase);
/// <summary>Gets the <see cref="T:System.Type" /> object with the specified name in the assembly instance, with the options of ignoring the case, and of throwing an exception if the type is not found.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the specified class.</returns>
/// <param name="name">The full name of the type. </param>
/// <param name="throwOnError">true to throw an exception if the type is not found; false to return null. </param>
/// <param name="ignoreCase">true to ignore the case of the type name; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> is invalid.-or- The length of <paramref name="name" /> exceeds 1024 characters. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.TypeLoadException">
/// <paramref name="throwOnError" /> is true, and the type cannot be found.</exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> requires a dependent assembly that could not be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="name" /> requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and <paramref name="name" /> requires a dependent assembly that was not preloaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> requires a dependent assembly, but the file is not a valid assembly. -or-<paramref name="name" /> requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.</exception>
// Token: 0x06001D19 RID: 7449 RVA: 0x0006D8A4 File Offset: 0x0006BAA4
public Type GetType(string name, bool throwOnError, bool ignoreCase)
{
if (name == null)
{
throw new ArgumentNullException(name);
}
if (name.Length == 0)
{
throw new ArgumentException("name", "Name cannot be empty");
}
return this.InternalGetType(null, name, throwOnError, ignoreCase);
}
// Token: 0x06001D1A RID: 7450
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern void InternalGetAssemblyName(string assemblyFile, AssemblyName aname);
// Token: 0x06001D1B RID: 7451
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void FillName(Assembly ass, AssemblyName aname);
/// <summary>Gets an <see cref="T:System.Reflection.AssemblyName" /> for this assembly, setting the codebase as specified by <paramref name="copiedName" />.</summary>
/// <returns>An <see cref="T:System.Reflection.AssemblyName" /> for this assembly.</returns>
/// <param name="copiedName">true to set the <see cref="P:System.Reflection.Assembly.CodeBase" /> to the location of the assembly after it was shadow copied; false to set <see cref="P:System.Reflection.Assembly.CodeBase" /> to the original location. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001D1C RID: 7452 RVA: 0x0006D8E4 File Offset: 0x0006BAE4
[MonoTODO("copiedName == true is not supported")]
public virtual AssemblyName GetName(bool copiedName)
{
if (SecurityManager.SecurityEnabled)
{
this.GetCodeBase(true);
}
return this.UnprotectedGetName();
}
/// <summary>Gets an <see cref="T:System.Reflection.AssemblyName" /> for this assembly.</summary>
/// <returns>An <see cref="T:System.Reflection.AssemblyName" /> for this assembly.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001D1D RID: 7453 RVA: 0x0006D900 File Offset: 0x0006BB00
public virtual AssemblyName GetName()
{
return this.GetName(false);
}
// Token: 0x06001D1E RID: 7454 RVA: 0x0006D90C File Offset: 0x0006BB0C
internal virtual AssemblyName UnprotectedGetName()
{
AssemblyName assemblyName = new AssemblyName();
Assembly.FillName(this, assemblyName);
return assemblyName;
}
/// <summary>Returns the full name of the assembly, also known as the display name.</summary>
/// <returns>The full name of the assembly, or the class name if the full name of the assembly cannot be determined.</returns>
// Token: 0x06001D1F RID: 7455 RVA: 0x0006D928 File Offset: 0x0006BB28
public override string ToString()
{
if (this.assemblyName != null)
{
return this.assemblyName;
}
this.assemblyName = this.get_fullname();
return this.assemblyName;
}
/// <summary>Creates the name of a type qualified by the display name of its assembly.</summary>
/// <returns>A String that is the full name of the type qualified by the display name of the assembly.</returns>
/// <param name="assemblyName">The display name of an assembly. </param>
/// <param name="typeName">The full name of a type. </param>
// Token: 0x06001D20 RID: 7456 RVA: 0x0006D95C File Offset: 0x0006BB5C
public static string CreateQualifiedName(string assemblyName, string typeName)
{
return typeName + ", " + assemblyName;
}
/// <summary>Gets the currently loaded assembly in which the specified class is defined.</summary>
/// <returns>The assembly in which the specified class is defined.</returns>
/// <param name="type">A <see cref="T:System.Type" /> object representing a class in the assembly that will be returned. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="type" /> is null. </exception>
// Token: 0x06001D21 RID: 7457 RVA: 0x0006D96C File Offset: 0x0006BB6C
public static Assembly GetAssembly(Type type)
{
if (type != null)
{
return type.Assembly;
}
throw new ArgumentNullException("type");
}
/// <summary>Gets the process executable in the default application domain. In other application domains, this is the first executable that was executed by <see cref="M:System.AppDomain.ExecuteAssembly(System.String)" />.</summary>
/// <returns>The Assembly that is the process executable in the default application domain, or the first executable that was executed by <see cref="M:System.AppDomain.ExecuteAssembly(System.String)" />. Can return null when called from unmanaged code.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D22 RID: 7458
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern Assembly GetEntryAssembly();
/// <summary>Gets the satellite assembly for the specified culture.</summary>
/// <returns>The specified satellite assembly.</returns>
/// <param name="culture">The specified culture. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="culture" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">The assembly cannot be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">The satellite assembly with a matching file name was found, but the CultureInfo did not match the one specified. </exception>
/// <exception cref="T:System.BadImageFormatException">The satellite assembly is not a valid assembly. </exception>
// Token: 0x06001D23 RID: 7459 RVA: 0x0006D988 File Offset: 0x0006BB88
public Assembly GetSatelliteAssembly(CultureInfo culture)
{
return this.GetSatelliteAssembly(culture, null, true);
}
/// <summary>Gets the specified version of the satellite assembly for the specified culture.</summary>
/// <returns>The specified satellite assembly.</returns>
/// <param name="culture">The specified culture. </param>
/// <param name="version">The version of the satellite assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="culture" /> is null. </exception>
/// <exception cref="T:System.IO.FileLoadException">The satellite assembly with a matching file name was found, but the CultureInfo or the version did not match the one specified. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">The assembly cannot be found. </exception>
/// <exception cref="T:System.BadImageFormatException">The satellite assembly is not a valid assembly. </exception>
// Token: 0x06001D24 RID: 7460 RVA: 0x0006D994 File Offset: 0x0006BB94
public Assembly GetSatelliteAssembly(CultureInfo culture, Version version)
{
return this.GetSatelliteAssembly(culture, version, true);
}
// Token: 0x06001D25 RID: 7461 RVA: 0x0006D9A0 File Offset: 0x0006BBA0
internal Assembly GetSatelliteAssemblyNoThrow(CultureInfo culture, Version version)
{
return this.GetSatelliteAssembly(culture, version, false);
}
// Token: 0x06001D26 RID: 7462 RVA: 0x0006D9AC File Offset: 0x0006BBAC
private Assembly GetSatelliteAssembly(CultureInfo culture, Version version, bool throwOnError)
{
if (culture == null)
{
throw new ArgumentException("culture");
}
AssemblyName name = this.GetName(true);
if (version != null)
{
name.Version = version;
}
name.CultureInfo = culture;
name.Name += ".resources";
try
{
Assembly assembly = AppDomain.CurrentDomain.LoadSatellite(name, false);
if (assembly != null)
{
return assembly;
}
}
catch (FileNotFoundException)
{
}
string directoryName = Path.GetDirectoryName(this.Location);
string text = Path.Combine(directoryName, Path.Combine(culture.Name, name.Name + ".dll"));
if (!throwOnError && !File.Exists(text))
{
return null;
}
return Assembly.LoadFrom(text);
}
// Token: 0x06001D27 RID: 7463
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern Assembly LoadFrom(string assemblyFile, bool refonly);
/// <summary>Loads an assembly given its file name or path.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyFile">The name or path of the file that contains the manifest of the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyFile" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyFile" /> is not found, or the module you are trying to load does not specify a filename extension. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyFile" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyFile" /> was compiled with a later version.</exception>
/// <exception cref="T:System.Security.SecurityException">A codebase that does not start with "file://" was specified without the required <see cref="T:System.Net.WebPermission" />. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="assemblyFile" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.PathTooLongException">The assembly name is longer than MAX_PATH characters.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D28 RID: 7464 RVA: 0x0006DA90 File Offset: 0x0006BC90
public static Assembly LoadFrom(string assemblyFile)
{
return Assembly.LoadFrom(assemblyFile, false);
}
/// <summary>Loads an assembly given its file name or path and supplying security evidence.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyFile">The name or path of the file that contains the manifest of the assembly. </param>
/// <param name="securityEvidence">Evidence for loading the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyFile" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyFile" /> is not found, or the module you are trying to load does not specify a filename extension. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded.-or-The <paramref name="securityEvidence" /> is not ambiguous and is determined to be invalid.</exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyFile" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyFile" /> was compiled with a later version.</exception>
/// <exception cref="T:System.Security.SecurityException">A codebase that does not start with "file://" was specified without the required <see cref="T:System.Net.WebPermission" />. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="assemblyFile" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.PathTooLongException">The assembly name is longer than MAX_PATH characters.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D29 RID: 7465 RVA: 0x0006DA9C File Offset: 0x0006BC9C
public static Assembly LoadFrom(string assemblyFile, Evidence securityEvidence)
{
return Assembly.LoadFrom(assemblyFile, false);
}
/// <summary>Loads an assembly given its file name or path, security evidence hash value, and hash algorithm.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyFile">The name or path of the file that contains the manifest of the assembly. </param>
/// <param name="securityEvidence">Evidence for loading the assembly. </param>
/// <param name="hashValue">The value of the computed hash code. </param>
/// <param name="hashAlgorithm">The hash algorithm used for hashing files and for generating the strong name. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyFile" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyFile" /> is not found, or the module you are trying to load does not specify a filename extension. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded.-or-The <paramref name="securityEvidence" /> is not ambiguous and is determined to be invalid. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyFile" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyFile" /> was compiled with a later version.</exception>
/// <exception cref="T:System.Security.SecurityException">A codebase that does not start with "file://" was specified without the required <see cref="T:System.Net.WebPermission" />. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="assemblyFile" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.PathTooLongException">The assembly name is longer than MAX_PATH characters.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D2A RID: 7466 RVA: 0x0006DAB4 File Offset: 0x0006BCB4
[MonoTODO("This overload is not currently implemented")]
public static Assembly LoadFrom(string assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
{
if (assemblyFile == null)
{
throw new ArgumentNullException("assemblyFile");
}
if (assemblyFile == string.Empty)
{
throw new ArgumentException("Name can't be the empty string", "assemblyFile");
}
throw new NotImplementedException();
}
/// <summary>Loads an assembly given its path, loading the assembly into the domain of the caller using the supplied evidence.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="path">The path of the assembly file. </param>
/// <param name="securityEvidence">Evidence for loading the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> parameter is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">The <paramref name="path" /> parameter is an empty string ("") or does not exist. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="path" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="path" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D2B RID: 7467 RVA: 0x0006DAF8 File Offset: 0x0006BCF8
public static Assembly LoadFile(string path, Evidence securityEvidence)
{
if (path == null)
{
throw new ArgumentNullException("path");
}
if (path == string.Empty)
{
throw new ArgumentException("Path can't be empty", "path");
}
return Assembly.LoadFrom(path, securityEvidence);
}
/// <summary>Loads the contents of an assembly file on the specified path.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="path">The path of the file to load. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="path" /> parameter is null. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">The <paramref name="path" /> parameter is an empty string ("") or does not exist. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="path" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="path" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D2C RID: 7468 RVA: 0x0006DB40 File Offset: 0x0006BD40
public static Assembly LoadFile(string path)
{
return Assembly.LoadFile(path, null);
}
/// <summary>Loads an assembly given the long form of its name.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyString">The long form of the assembly name. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyString" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="assemblyString" /> is a zero-length string. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyString" /> is not found. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyString" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyString" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D2D RID: 7469 RVA: 0x0006DB4C File Offset: 0x0006BD4C
public static Assembly Load(string assemblyString)
{
return AppDomain.CurrentDomain.Load(assemblyString);
}
/// <summary>Loads an assembly given its display name, loading the assembly into the domain of the caller using the supplied evidence.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyString">The display name of the assembly. </param>
/// <param name="assemblySecurity">Evidence for loading the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyString" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyString" /> is not found. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyString" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyString" /> was compiled with a later version.</exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded.-or-An assembly or module was loaded twice with two different evidences. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D2E RID: 7470 RVA: 0x0006DB5C File Offset: 0x0006BD5C
public static Assembly Load(string assemblyString, Evidence assemblySecurity)
{
return AppDomain.CurrentDomain.Load(assemblyString, assemblySecurity);
}
/// <summary>Loads an assembly given its <see cref="T:System.Reflection.AssemblyName" />.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyRef">The <see cref="T:System.Reflection.AssemblyName" /> object that describes the assembly to be loaded. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyRef" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyRef" /> is not found. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyRef" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyRef" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D2F RID: 7471 RVA: 0x0006DB6C File Offset: 0x0006BD6C
public static Assembly Load(AssemblyName assemblyRef)
{
return AppDomain.CurrentDomain.Load(assemblyRef);
}
/// <summary>Loads an assembly given its <see cref="T:System.Reflection.AssemblyName" />. The assembly is loaded into the domain of the caller using the supplied evidence.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="assemblyRef">The <see cref="T:System.Reflection.AssemblyName" /> object that describes the assembly to be loaded. </param>
/// <param name="assemblySecurity">Evidence for loading the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyRef" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyRef" /> is not found. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyRef" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyRef" /> was compiled with a later version.</exception>
/// <exception cref="T:System.IO.FileLoadException">An assembly or module was loaded twice with two different evidences. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D30 RID: 7472 RVA: 0x0006DB7C File Offset: 0x0006BD7C
public static Assembly Load(AssemblyName assemblyRef, Evidence assemblySecurity)
{
return AppDomain.CurrentDomain.Load(assemblyRef, assemblySecurity);
}
/// <summary>Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the domain of the caller.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="rawAssembly">An array of type byte that is a COFF-based image containing an emitted assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rawAssembly" /> is null. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="rawAssembly" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="rawAssembly" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D31 RID: 7473 RVA: 0x0006DB8C File Offset: 0x0006BD8C
public static Assembly Load(byte[] rawAssembly)
{
return AppDomain.CurrentDomain.Load(rawAssembly);
}
/// <summary>Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="rawAssembly">An array of type byte that is a COFF-based image containing an emitted assembly. </param>
/// <param name="rawSymbolStore">An array of type byte containing the raw bytes representing the symbols for the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rawAssembly" /> is null. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="rawAssembly" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="rawAssembly" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D32 RID: 7474 RVA: 0x0006DB9C File Offset: 0x0006BD9C
public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore)
{
return AppDomain.CurrentDomain.Load(rawAssembly, rawSymbolStore);
}
/// <summary>Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly.</summary>
/// <returns>The loaded assembly.</returns>
/// <param name="rawAssembly">An array of type byte that is a COFF-based image containing an emitted assembly. </param>
/// <param name="rawSymbolStore">An array of type byte containing the raw bytes representing the symbols for the assembly. </param>
/// <param name="securityEvidence">Evidence for loading the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rawAssembly" /> is null. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="rawAssembly" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="rawAssembly" /> was compiled with a later version.</exception>
/// <exception cref="T:System.IO.FileLoadException">An assembly or module was loaded twice with two different evidences. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D33 RID: 7475 RVA: 0x0006DBAC File Offset: 0x0006BDAC
public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
{
return AppDomain.CurrentDomain.Load(rawAssembly, rawSymbolStore, securityEvidence);
}
/// <summary>Loads the assembly from a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the reflection-only context of the caller's application domain.</summary>
/// <returns>An <see cref="T:System.Reflection.Assembly" /> object that represents the loaded assembly.</returns>
/// <param name="rawAssembly">An array of type byte that is a COFF-based image containing an emitted assembly.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="rawAssembly" /> is null. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="rawAssembly" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="rawAssembly" /> was compiled with a later version.</exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="rawAssembly" /> cannot be loaded. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D34 RID: 7476 RVA: 0x0006DBBC File Offset: 0x0006BDBC
public static Assembly ReflectionOnlyLoad(byte[] rawAssembly)
{
return AppDomain.CurrentDomain.Load(rawAssembly, null, null, true);
}
/// <summary>Loads an assembly into the reflection-only context, given its display name.</summary>
/// <returns>An <see cref="T:System.Reflection.Assembly" /> object that represents the loaded assembly.</returns>
/// <param name="assemblyString">The display name of the assembly, as returned by the <see cref="P:System.Reflection.AssemblyName.FullName" /> property.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyString" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="assemblyString" /> is an empty string (""). </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyString" /> is not found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="assemblyString" /> is found, but cannot be loaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyString" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyString" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D35 RID: 7477 RVA: 0x0006DBCC File Offset: 0x0006BDCC
public static Assembly ReflectionOnlyLoad(string assemblyString)
{
return AppDomain.CurrentDomain.Load(assemblyString, null, true);
}
/// <summary>Loads an assembly into the reflection-only context, given its path.</summary>
/// <returns>An <see cref="T:System.Reflection.Assembly" /> object that represents the loaded assembly.</returns>
/// <param name="assemblyFile">The path of the file that contains the manifest of the assembly.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyFile" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="assemblyFile" /> is not found, or the module you are trying to load does not specify a file name extension. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="assemblyFile" /> is found, but could not be loaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyFile" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="assemblyFile" /> was compiled with a later version.</exception>
/// <exception cref="T:System.Security.SecurityException">A codebase that does not start with "file://" was specified without the required <see cref="T:System.Net.WebPermission" />. </exception>
/// <exception cref="T:System.IO.PathTooLongException">The assembly name is longer than MAX_PATH characters. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="assemblyFile" /> is an empty string (""). </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// </PermissionSet>
// Token: 0x06001D36 RID: 7478 RVA: 0x0006DBDC File Offset: 0x0006BDDC
public static Assembly ReflectionOnlyLoadFrom(string assemblyFile)
{
if (assemblyFile == null)
{
throw new ArgumentNullException("assemblyFile");
}
return Assembly.LoadFrom(assemblyFile, true);
}
/// <summary>Loads an assembly from the application directory or from the global assembly cache using a partial name.</summary>
/// <returns>The loaded assembly. If <paramref name="partialName" /> is not found, this method returns null.</returns>
/// <param name="partialName">The display name of the assembly. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="partialName" /> parameter is null. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyFile" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="partialName" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D37 RID: 7479 RVA: 0x0006DBF8 File Offset: 0x0006BDF8
[Obsolete("")]
public static Assembly LoadWithPartialName(string partialName)
{
return Assembly.LoadWithPartialName(partialName, null);
}
/// <summary>Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file.</summary>
/// <returns>The loaded Module.</returns>
/// <param name="moduleName">Name of the module. Must correspond to a file name in this assembly's manifest. </param>
/// <param name="rawModule">A byte array that is a COFF-based image containing an emitted module, or a resource. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="moduleName" /> or <paramref name="rawModule" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="moduleName" /> does not match a file entry in this assembly's manifest. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="rawModule" /> is not a valid module. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D38 RID: 7480 RVA: 0x0006DC04 File Offset: 0x0006BE04
[MonoTODO("Not implemented")]
public Module LoadModule(string moduleName, byte[] rawModule)
{
throw new NotImplementedException();
}
/// <summary>Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file. The raw bytes representing the symbols for the module are also loaded.</summary>
/// <returns>The loaded module.</returns>
/// <param name="moduleName">Name of the module. Must correspond to a file name in this assembly's manifest. </param>
/// <param name="rawModule">A byte array that is a COFF-based image containing an emitted module, or a resource. </param>
/// <param name="rawSymbolStore">A byte array containing the raw bytes representing the symbols for the module. Must be null if this is a resource file. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="moduleName" /> or <paramref name="rawModule" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="moduleName" /> does not match a file entry in this assembly's manifest. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="rawModule" /> is not a valid module. </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D39 RID: 7481 RVA: 0x0006DC0C File Offset: 0x0006BE0C
[MonoTODO("Not implemented")]
public Module LoadModule(string moduleName, byte[] rawModule, byte[] rawSymbolStore)
{
throw new NotImplementedException();
}
// Token: 0x06001D3A RID: 7482
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern Assembly load_with_partial_name(string name, Evidence e);
/// <summary>Loads an assembly from the application directory or from the global assembly cache using a partial name. The assembly is loaded into the domain of the caller using the supplied evidence.</summary>
/// <returns>The loaded assembly. If <paramref name="partialName" /> is not found, this method returns null.</returns>
/// <param name="partialName">The display name of the assembly. </param>
/// <param name="securityEvidence">
/// <see cref="T:System.Security.Policy.Evidence" /> for loading the assembly. </param>
/// <exception cref="T:System.IO.FileLoadException">An assembly or module was loaded twice with two different sets of evidence. </exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="partialName" /> parameter is null. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="assemblyFile" /> is not a valid assembly. -or-Version 2.0 or later of the common language runtime is currently loaded and <paramref name="partialName" /> was compiled with a later version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
/// </PermissionSet>
// Token: 0x06001D3B RID: 7483 RVA: 0x0006DC14 File Offset: 0x0006BE14
[Obsolete("")]
public static Assembly LoadWithPartialName(string partialName, Evidence securityEvidence)
{
return Assembly.LoadWithPartialName(partialName, securityEvidence, true);
}
// Token: 0x06001D3C RID: 7484 RVA: 0x0006DC20 File Offset: 0x0006BE20
internal static Assembly LoadWithPartialName(string partialName, Evidence securityEvidence, bool oldBehavior)
{
if (!oldBehavior)
{
throw new NotImplementedException();
}
if (partialName == null)
{
throw new NullReferenceException();
}
return Assembly.load_with_partial_name(partialName, securityEvidence);
}
/// <summary>Locates the specified type from this assembly and creates an instance of it using the system activator, using case-sensitive search.</summary>
/// <returns>An instance of <see cref="T:System.Object" /> representing the type, with culture, arguments, binder, and activation attributes set to null, and <see cref="T:System.Reflection.BindingFlags" /> set to Public or Instance, or null if <paramref name="typeName" /> is not found.</returns>
/// <param name="typeName">The <see cref="P:System.Type.FullName" /> of the type to locate. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="typeName" /> is an empty string ("") or a string beginning with a null character.-or-The current assembly was loaded into the reflection-only context.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="typeName" /> is null. </exception>
/// <exception cref="T:System.MissingMethodException">No matching constructor was found. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="typeName" /> requires a dependent assembly that could not be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="typeName" /> requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and <paramref name="typeName" /> requires a dependent assembly that was not preloaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="typeName" /> requires a dependent assembly, but the file is not a valid assembly. -or-<paramref name="typeName" /> requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x06001D3D RID: 7485 RVA: 0x0006DC44 File Offset: 0x0006BE44
public object CreateInstance(string typeName)
{
return this.CreateInstance(typeName, false);
}
/// <summary>Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search.</summary>
/// <returns>An instance of <see cref="T:System.Object" /> representing the type, with culture, arguments, binder, and activation attributes set to null, and <see cref="T:System.Reflection.BindingFlags" /> set to Public or Instance, or null if <paramref name="typeName" /> is not found.</returns>
/// <param name="typeName">The <see cref="P:System.Type.FullName" /> of the type to locate. </param>
/// <param name="ignoreCase">true to ignore the case of the type name; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="typeName" /> is an empty string ("") or a string beginning with a null character. -or-The current assembly was loaded into the reflection-only context.</exception>
/// <exception cref="T:System.MissingMethodException">No matching constructor was found. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="typeName" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="typeName" /> requires a dependent assembly that could not be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="typeName" /> requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and <paramref name="typeName" /> requires a dependent assembly that was not preloaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="typeName" /> requires a dependent assembly, but the file is not a valid assembly. -or-<paramref name="typeName" /> requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x06001D3E RID: 7486 RVA: 0x0006DC50 File Offset: 0x0006BE50
public object CreateInstance(string typeName, bool ignoreCase)
{
Type type = this.GetType(typeName, false, ignoreCase);
if (type == null)
{
return null;
}
object obj;
try
{
obj = Activator.CreateInstance(type);
}
catch (InvalidOperationException)
{
throw new ArgumentException("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
}
return obj;
}
/// <summary>Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes.</summary>
/// <returns>An instance of Object representing the type and matching the specified criteria, or null if <paramref name="typeName" /> is not found.</returns>
/// <param name="typeName">The <see cref="P:System.Type.FullName" /> of the type to locate. </param>
/// <param name="ignoreCase">true to ignore the case of the type name; otherwise, false. </param>
/// <param name="bindingAttr">A bitmask that affects the way in which the search is conducted. The value is a combination of bit flags from <see cref="T:System.Reflection.BindingFlags" />. </param>
/// <param name="binder">An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If <paramref name="binder" /> is null, the default binder is used. </param>
/// <param name="args">An array of type Object containing the arguments to be passed to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to be invoked. If the default constructor is desired, <paramref name="args" /> must be an empty array or null. </param>
/// <param name="culture">An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) </param>
/// <param name="activationAttributes">An array of one or more attributes that can participate in activation. Typically, an array that contains a single <see cref="T:System.Runtime.Remoting.Activation.UrlAttribute" /> object. The <see cref="T:System.Runtime.Remoting.Activation.UrlAttribute" /> specifies the URL that is required to activate a remote object. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="typeName" /> is an empty string ("") or a string beginning with a null character. -or-The current assembly was loaded into the reflection-only context.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="typeName" /> is null. </exception>
/// <exception cref="T:System.MissingMethodException">No matching constructor was found. </exception>
/// <exception cref="T:System.NotSupportedException">A non-empty activation attributes array is passed to a type that does not inherit from <see cref="T:System.MarshalByRefObject" />. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="typeName" /> requires a dependent assembly that could not be found. </exception>
/// <exception cref="T:System.IO.FileLoadException">
/// <paramref name="typeName" /> requires a dependent assembly that was found but could not be loaded.-or-The current assembly was loaded into the reflection-only context, and <paramref name="typeName" /> requires a dependent assembly that was not preloaded. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="typeName" /> requires a dependent assembly, but the file is not a valid assembly. -or-<paramref name="typeName" /> requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x06001D3F RID: 7487 RVA: 0x0006DCB0 File Offset: 0x0006BEB0
public object CreateInstance(string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
{
Type type = this.GetType(typeName, false, ignoreCase);
if (type == null)
{
return null;
}
object obj;
try
{
obj = Activator.CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
}
catch (InvalidOperationException)
{
throw new ArgumentException("It is illegal to invoke a method on a Type loaded via ReflectionOnly methods.");
}
return obj;
}
/// <summary>Gets all the loaded modules that are part of this assembly.</summary>
/// <returns>An array of modules.</returns>
// Token: 0x06001D40 RID: 7488 RVA: 0x0006DD18 File Offset: 0x0006BF18
public Module[] GetLoadedModules()
{
return this.GetLoadedModules(false);
}
/// <summary>Gets all the loaded modules that are part of this assembly, specifying whether to include resource modules.</summary>
/// <returns>An array of modules.</returns>
/// <param name="getResourceModules">true to include resource modules; otherwise, false. </param>
// Token: 0x06001D41 RID: 7489 RVA: 0x0006DD24 File Offset: 0x0006BF24
public Module[] GetLoadedModules(bool getResourceModules)
{
return this.GetModules(getResourceModules);
}
/// <summary>Gets all the modules that are part of this assembly.</summary>
/// <returns>An array of modules.</returns>
/// <exception cref="T:System.IO.FileNotFoundException">The module to be loaded does not specify a file name extension. </exception>
// Token: 0x06001D42 RID: 7490 RVA: 0x0006DD30 File Offset: 0x0006BF30
public Module[] GetModules()
{
return this.GetModules(false);
}
/// <summary>Gets the specified module in this assembly.</summary>
/// <returns>The module being requested, or null if the module is not found.</returns>
/// <param name="name">The name of the module being requested. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="name" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="name" /> parameter is an empty string (""). </exception>
/// <exception cref="T:System.IO.FileLoadException">A file that was found could not be loaded. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="name" /> was not found. </exception>
/// <exception cref="T:System.BadImageFormatException">
/// <paramref name="name" /> is not a valid assembly. </exception>
// Token: 0x06001D43 RID: 7491 RVA: 0x0006DD3C File Offset: 0x0006BF3C
public Module GetModule(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name.Length == 0)
{
throw new ArgumentException("Name can't be empty");
}
Module[] modules = this.GetModules(true);
foreach (Module module in modules)
{
if (module.ScopeName == name)
{
return module;
}
}
return null;
}
// Token: 0x06001D44 RID: 7492
[MethodImpl(MethodImplOptions.InternalCall)]
internal virtual extern Module[] GetModulesInternal();
/// <summary>Gets all the modules that are part of this assembly, specifying whether to include resource modules.</summary>
/// <returns>An array of modules.</returns>
/// <param name="getResourceModules">true to include resource modules; otherwise, false. </param>
// Token: 0x06001D45 RID: 7493 RVA: 0x0006DDA8 File Offset: 0x0006BFA8
public Module[] GetModules(bool getResourceModules)
{
Module[] modulesInternal = this.GetModulesInternal();
if (!getResourceModules)
{
ArrayList arrayList = new ArrayList(modulesInternal.Length);
foreach (Module module in modulesInternal)
{
if (!module.IsResource())
{
arrayList.Add(module);
}
}
return (Module[])arrayList.ToArray(typeof(Module));
}
return modulesInternal;
}
// Token: 0x06001D46 RID: 7494
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern string[] GetNamespaces();
/// <summary>Returns the names of all the resources in this assembly.</summary>
/// <returns>An array of type String containing the names of all the resources.</returns>
// Token: 0x06001D47 RID: 7495
[MethodImpl(MethodImplOptions.InternalCall)]
public virtual extern string[] GetManifestResourceNames();
/// <summary>Gets the assembly that contains the code that is currently executing.</summary>
/// <returns>A <see cref="T:System.Reflection.Assembly" /> representing the assembly that contains the code that is currently executing. </returns>
// Token: 0x06001D48 RID: 7496
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern Assembly GetExecutingAssembly();
/// <summary>Returns the <see cref="T:System.Reflection.Assembly" /> of the method that invoked the currently executing method.</summary>
/// <returns>The Assembly object of the method that invoked the currently executing method.</returns>
// Token: 0x06001D49 RID: 7497
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern Assembly GetCallingAssembly();
/// <summary>Gets the <see cref="T:System.Reflection.AssemblyName" /> objects for all the assemblies referenced by this assembly.</summary>
/// <returns>An array of type <see cref="T:System.Reflection.AssemblyName" /> containing all the assemblies referenced by this assembly.</returns>
// Token: 0x06001D4A RID: 7498
[MethodImpl(MethodImplOptions.InternalCall)]
public extern AssemblyName[] GetReferencedAssemblies();
// Token: 0x06001D4B RID: 7499
[MethodImpl(MethodImplOptions.InternalCall)]
private extern bool GetManifestResourceInfoInternal(string name, ManifestResourceInfo info);
/// <summary>Returns information about how the given resource has been persisted.</summary>
/// <returns>
/// <see cref="T:System.Reflection.ManifestResourceInfo" /> populated with information about the resource's topology, or null if the resource is not found.</returns>
/// <param name="resourceName">The case-sensitive name of the resource. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="resourceName" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="resourceName" /> parameter is an empty string (""). </exception>
// Token: 0x06001D4C RID: 7500 RVA: 0x0006DE14 File Offset: 0x0006C014
public virtual ManifestResourceInfo GetManifestResourceInfo(string resourceName)
{
if (resourceName == null)
{
throw new ArgumentNullException("resourceName");
}
if (resourceName.Length == 0)
{
throw new ArgumentException("String cannot have zero length.");
}
ManifestResourceInfo manifestResourceInfo = new ManifestResourceInfo();
bool manifestResourceInfoInternal = this.GetManifestResourceInfoInternal(resourceName, manifestResourceInfo);
if (manifestResourceInfoInternal)
{
return manifestResourceInfo;
}
return null;
}
// Token: 0x06001D4D RID: 7501
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern int MonoDebugger_GetMethodToken(MethodBase method);
/// <summary>Gets the host context with which the assembly was loaded.</summary>
/// <returns>An <see cref="T:System.Int64" /> value that indicates the host context with which the assembly was loaded, if any.</returns>
// Token: 0x1700053B RID: 1339
// (get) Token: 0x06001D4E RID: 7502 RVA: 0x0006DE60 File Offset: 0x0006C060
[MonoTODO("Always returns zero")]
[ComVisible(false)]
public long HostContext
{
get
{
return 0L;
}
}
/// <summary>Gets the module that contains the manifest for the current assembly. </summary>
/// <returns>A <see cref="T:System.Reflection.Module" /> object representing the module that contains the manifest for the assembly. </returns>
// Token: 0x1700053C RID: 1340
// (get) Token: 0x06001D4F RID: 7503 RVA: 0x0006DE64 File Offset: 0x0006C064
[ComVisible(false)]
public Module ManifestModule
{
get
{
return this.GetManifestModule();
}
}
// Token: 0x06001D50 RID: 7504 RVA: 0x0006DE6C File Offset: 0x0006C06C
internal virtual Module GetManifestModule()
{
return this.GetManifestModuleInternal();
}
// Token: 0x06001D51 RID: 7505
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern Module GetManifestModuleInternal();
/// <summary>Gets a <see cref="T:System.Boolean" /> value indicating whether this assembly was loaded into the reflection-only context.</summary>
/// <returns>true if the assembly was loaded into the reflection-only context, rather than the execution context; otherwise, false.</returns>
// Token: 0x1700053D RID: 1341
// (get) Token: 0x06001D52 RID: 7506
[ComVisible(false)]
public virtual extern bool ReflectionOnly
{
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
// Token: 0x06001D53 RID: 7507 RVA: 0x0006DE74 File Offset: 0x0006C074
internal void Resolve()
{
lock (this)
{
this.LoadAssemblyPermissions();
Evidence evidence = new Evidence(this.UnprotectedGetEvidence());
evidence.AddHost(new PermissionRequestEvidence(this._minimum, this._optional, this._refuse));
this._granted = SecurityManager.ResolvePolicy(evidence, this._minimum, this._optional, this._refuse, out this._denied);
}
}
// Token: 0x1700053E RID: 1342
// (get) Token: 0x06001D54 RID: 7508 RVA: 0x0006DF04 File Offset: 0x0006C104
internal PermissionSet GrantedPermissionSet
{
get
{
if (this._granted == null)
{
if (SecurityManager.ResolvingPolicyLevel != null)
{
if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly(this))
{
return DefaultPolicies.FullTrust;
}
return null;
}
else
{
this.Resolve();
}
}
return this._granted;
}
}
// Token: 0x1700053F RID: 1343
// (get) Token: 0x06001D55 RID: 7509 RVA: 0x0006DF4C File Offset: 0x0006C14C
internal PermissionSet DeniedPermissionSet
{
get
{
if (this._granted == null)
{
if (SecurityManager.ResolvingPolicyLevel != null)
{
if (SecurityManager.ResolvingPolicyLevel.IsFullTrustAssembly(this))
{
return null;
}
return DefaultPolicies.FullTrust;
}
else
{
this.Resolve();
}
}
return this._denied;
}
}
// Token: 0x06001D56 RID: 7510
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern bool LoadPermissions(Assembly a, ref IntPtr minimum, ref int minLength, ref IntPtr optional, ref int optLength, ref IntPtr refused, ref int refLength);
// Token: 0x06001D57 RID: 7511 RVA: 0x0006DF94 File Offset: 0x0006C194
private void LoadAssemblyPermissions()
{
IntPtr zero = IntPtr.Zero;
IntPtr zero2 = IntPtr.Zero;
IntPtr zero3 = IntPtr.Zero;
int num = 0;
int num2 = 0;
int num3 = 0;
if (Assembly.LoadPermissions(this, ref zero, ref num, ref zero2, ref num2, ref zero3, ref num3))
{
if (num > 0)
{
byte[] array = new byte[num];
Marshal.Copy(zero, array, 0, num);
this._minimum = SecurityManager.Decode(array);
}
if (num2 > 0)
{
byte[] array2 = new byte[num2];
Marshal.Copy(zero2, array2, 0, num2);
this._optional = SecurityManager.Decode(array2);
}
if (num3 > 0)
{
byte[] array3 = new byte[num3];
Marshal.Copy(zero3, array3, 0, num3);
this._refuse = SecurityManager.Decode(array3);
}
}
}
/// <summary>Returns the type of the current instance.</summary>
/// <returns>A <see cref="T:System.Type" /> object representing the <see cref="T:System.Reflection.Assembly" /> type.</returns>
// Token: 0x06001D58 RID: 7512 RVA: 0x0006E04C File Offset: 0x0006C24C
virtual Type System.Runtime.InteropServices._Assembly.GetType()
{
return base.GetType();
}
// Token: 0x040009D3 RID: 2515
private IntPtr _mono_assembly;
// Token: 0x040009D4 RID: 2516
private Assembly.ResolveEventHolder resolve_event_holder;
// Token: 0x040009D5 RID: 2517
private Evidence _evidence;
// Token: 0x040009D6 RID: 2518
internal PermissionSet _minimum;
// Token: 0x040009D7 RID: 2519
internal PermissionSet _optional;
// Token: 0x040009D8 RID: 2520
internal PermissionSet _refuse;
// Token: 0x040009D9 RID: 2521
private PermissionSet _granted;
// Token: 0x040009DA RID: 2522
private PermissionSet _denied;
// Token: 0x040009DB RID: 2523
private bool fromByteArray;
// Token: 0x040009DC RID: 2524
private string assemblyName;
// Token: 0x02000220 RID: 544
internal class ResolveEventHolder
{
// Token: 0x14000005 RID: 5
// (add) Token: 0x06001D5A RID: 7514 RVA: 0x0006E05C File Offset: 0x0006C25C
// (remove) Token: 0x06001D5B RID: 7515 RVA: 0x0006E078 File Offset: 0x0006C278
public event ModuleResolveEventHandler ModuleResolve;
}
// Token: 0x02000221 RID: 545
private class ResourceCloseHandler
{
// Token: 0x06001D5C RID: 7516 RVA: 0x0006E094 File Offset: 0x0006C294
public ResourceCloseHandler(Module module)
{
this.module = module;
}
// Token: 0x06001D5D RID: 7517 RVA: 0x0006E0A4 File Offset: 0x0006C2A4
public void OnClose(object sender, EventArgs e)
{
this.module = null;
}
// Token: 0x040009DE RID: 2526
private Module module;
}
}
}