This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,72 @@
using System;
using System.Text;
namespace System.Reflection.Emit
{
// Token: 0x020001E8 RID: 488
internal class ArrayType : DerivedType
{
// Token: 0x06001966 RID: 6502 RVA: 0x0006169C File Offset: 0x0005F89C
internal ArrayType(Type elementType, int rank)
: base(elementType)
{
this.rank = rank;
}
// Token: 0x06001967 RID: 6503 RVA: 0x000616AC File Offset: 0x0005F8AC
protected override bool IsArrayImpl()
{
return true;
}
// Token: 0x06001968 RID: 6504 RVA: 0x000616B0 File Offset: 0x0005F8B0
public override int GetArrayRank()
{
return (this.rank != 0) ? this.rank : 1;
}
// Token: 0x17000478 RID: 1144
// (get) Token: 0x06001969 RID: 6505 RVA: 0x000616CC File Offset: 0x0005F8CC
public override Type BaseType
{
get
{
return typeof(Array);
}
}
// Token: 0x0600196A RID: 6506 RVA: 0x000616D8 File Offset: 0x0005F8D8
protected override TypeAttributes GetAttributeFlagsImpl()
{
if (((ModuleBuilder)this.elementType.Module).assemblyb.IsCompilerContext)
{
return (this.elementType.Attributes & TypeAttributes.VisibilityMask) | TypeAttributes.Sealed | TypeAttributes.Serializable;
}
return this.elementType.Attributes;
}
// Token: 0x0600196B RID: 6507 RVA: 0x0006172C File Offset: 0x0005F92C
internal override string FormatName(string elementName)
{
if (elementName == null)
{
return null;
}
StringBuilder stringBuilder = new StringBuilder(elementName);
stringBuilder.Append("[");
for (int i = 1; i < this.rank; i++)
{
stringBuilder.Append(",");
}
if (this.rank == 1)
{
stringBuilder.Append("*");
}
stringBuilder.Append("]");
return stringBuilder.ToString();
}
// Token: 0x0400078C RID: 1932
private int rank;
}
}
@@ -0,0 +1,1525 @@
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using Mono.Security;
namespace System.Reflection.Emit
{
/// <summary>Defines and represents a dynamic assembly.</summary>
// Token: 0x020001E0 RID: 480
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
[ComDefaultInterface(typeof(_AssemblyBuilder))]
public sealed class AssemblyBuilder : Assembly, _AssemblyBuilder
{
// Token: 0x0600189B RID: 6299 RVA: 0x0005E2D8 File Offset: 0x0005C4D8
internal AssemblyBuilder(AssemblyName n, string directory, AssemblyBuilderAccess access, bool corlib_internal)
{
this.is_compiler_context = (access & (AssemblyBuilderAccess)2048) != (AssemblyBuilderAccess)0;
access &= (AssemblyBuilderAccess)(-2049);
if (!Enum.IsDefined(typeof(AssemblyBuilderAccess), access))
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Argument value {0} is not valid.", new object[] { (int)access }), "access");
}
this.name = n.Name;
this.access = (uint)access;
this.flags = (uint)n.Flags;
if (this.IsSave && (directory == null || directory.Length == 0))
{
this.dir = Directory.GetCurrentDirectory();
}
else
{
this.dir = directory;
}
if (n.CultureInfo != null)
{
this.culture = n.CultureInfo.Name;
this.versioninfo_culture = n.CultureInfo.Name;
}
Version version = n.Version;
if (version != null)
{
this.version = version.ToString();
}
if (n.KeyPair != null)
{
this.sn = n.KeyPair.StrongName();
}
else
{
byte[] publicKey = n.GetPublicKey();
if (publicKey != null && publicKey.Length > 0)
{
this.sn = new StrongName(publicKey);
}
}
if (this.sn != null)
{
this.flags |= 1U;
}
this.corlib_internal = corlib_internal;
if (this.sn != null)
{
this.pktoken = new byte[this.sn.PublicKeyToken.Length * 2];
int num = 0;
foreach (byte b in this.sn.PublicKeyToken)
{
string text = b.ToString("x2");
this.pktoken[num++] = (byte)text[0];
this.pktoken[num++] = (byte)text[1];
}
}
AssemblyBuilder.basic_init(this);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x0600189C RID: 6300 RVA: 0x0005E524 File Offset: 0x0005C724
void _AssemblyBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x0600189D RID: 6301 RVA: 0x0005E52C File Offset: 0x0005C72C
void _AssemblyBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x0600189E RID: 6302 RVA: 0x0005E534 File Offset: 0x0005C734
void _AssemblyBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x0600189F RID: 6303 RVA: 0x0005E53C File Offset: 0x0005C73C
void _AssemblyBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x060018A0 RID: 6304
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void basic_init(AssemblyBuilder ab);
/// <summary>Gets the location of the assembly, as specified originally (such as in an <see cref="T:System.Reflection.AssemblyName" /> object).</summary>
/// <returns>The location of the assembly, as specified originally.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x1700044A RID: 1098
// (get) Token: 0x060018A1 RID: 6305 RVA: 0x0005E544 File Offset: 0x0005C744
public override string CodeBase
{
get
{
throw this.not_supported();
}
}
/// <summary>Returns the entry point of this assembly.</summary>
/// <returns>The entry point of this assembly.</returns>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x1700044B RID: 1099
// (get) Token: 0x060018A2 RID: 6306 RVA: 0x0005E54C File Offset: 0x0005C74C
public override MethodInfo EntryPoint
{
get
{
return this.entry_point;
}
}
/// <summary>Gets the location, in codebase format, of the loaded file that contains the manifest if it is not shadow-copied.</summary>
/// <returns>The location of the loaded file that contains the manifest. If the loaded file has been shadow-copied, the Location is that of the file before being shadow-copied.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x1700044C RID: 1100
// (get) Token: 0x060018A3 RID: 6307 RVA: 0x0005E554 File Offset: 0x0005C754
public override string Location
{
get
{
throw this.not_supported();
}
}
/// <summary>Gets the version of the common language runtime that will be saved in the file containing the manifest.</summary>
/// <returns>A string representing the common language runtime version.</returns>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x1700044D RID: 1101
// (get) Token: 0x060018A4 RID: 6308 RVA: 0x0005E55C File Offset: 0x0005C75C
public override string ImageRuntimeVersion
{
get
{
return base.ImageRuntimeVersion;
}
}
/// <summary>Gets a value indicating whether the dynamic assembly is in the reflection-only context.</summary>
/// <returns>true if the dynamic assembly is in the reflection-only context; otherwise, false.</returns>
// Token: 0x1700044E RID: 1102
// (get) Token: 0x060018A5 RID: 6309 RVA: 0x0005E564 File Offset: 0x0005C764
[MonoTODO]
public override bool ReflectionOnly
{
get
{
return base.ReflectionOnly;
}
}
/// <summary>Adds an existing resource file to this assembly.</summary>
/// <param name="name">The logical name of the resource. </param>
/// <param name="fileName">The physical file name (.resources file) to which the logical name is mapped. This should not include a path; the file must be in the same directory as the assembly to which it is added. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> has been previously defined.-or- There is another file in the assembly named <paramref name="fileName" />.-or- The length of <paramref name="name" /> is zero.-or- The length of <paramref name="fileName" /> is zero, or if <paramref name="fileName" /> includes a path. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="fileName" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">The file <paramref name="fileName" /> is not found. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018A6 RID: 6310 RVA: 0x0005E56C File Offset: 0x0005C76C
public void AddResourceFile(string name, string fileName)
{
this.AddResourceFile(name, fileName, ResourceAttributes.Public);
}
/// <summary>Adds an existing resource file to this assembly.</summary>
/// <param name="name">The logical name of the resource. </param>
/// <param name="fileName">The physical file name (.resources file) to which the logical name is mapped. This should not include a path; the file must be in the same directory as the assembly to which it is added. </param>
/// <param name="attribute">The resource attributes. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> has been previously defined.-or- There is another file in the assembly named <paramref name="fileName" />.-or- The length of <paramref name="name" /> is zero or if the length of <paramref name="fileName" /> is zero.-or- <paramref name="fileName" /> includes a path. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="fileName" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">If the file <paramref name="fileName" /> is not found. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018A7 RID: 6311 RVA: 0x0005E578 File Offset: 0x0005C778
public void AddResourceFile(string name, string fileName, ResourceAttributes attribute)
{
this.AddResourceFile(name, fileName, attribute, true);
}
// Token: 0x060018A8 RID: 6312 RVA: 0x0005E584 File Offset: 0x0005C784
private void AddResourceFile(string name, string fileName, ResourceAttributes attribute, bool fileNeedsToExists)
{
this.check_name_and_filename(name, fileName, fileNeedsToExists);
if (this.dir != null)
{
fileName = Path.Combine(this.dir, fileName);
}
if (this.resources != null)
{
MonoResource[] array = new MonoResource[this.resources.Length + 1];
Array.Copy(this.resources, array, this.resources.Length);
this.resources = array;
}
else
{
this.resources = new MonoResource[1];
}
int num = this.resources.Length - 1;
this.resources[num].name = name;
this.resources[num].filename = fileName;
this.resources[num].attrs = attribute;
}
// Token: 0x060018A9 RID: 6313 RVA: 0x0005E63C File Offset: 0x0005C83C
internal void AddPermissionRequests(PermissionSet required, PermissionSet optional, PermissionSet refused)
{
}
// Token: 0x060018AA RID: 6314 RVA: 0x0005E640 File Offset: 0x0005C840
internal void EmbedResourceFile(string name, string fileName)
{
this.EmbedResourceFile(name, fileName, ResourceAttributes.Public);
}
// Token: 0x060018AB RID: 6315 RVA: 0x0005E64C File Offset: 0x0005C84C
internal void EmbedResourceFile(string name, string fileName, ResourceAttributes attribute)
{
if (this.resources != null)
{
MonoResource[] array = new MonoResource[this.resources.Length + 1];
Array.Copy(this.resources, array, this.resources.Length);
this.resources = array;
}
else
{
this.resources = new MonoResource[1];
}
int num = this.resources.Length - 1;
this.resources[num].name = name;
this.resources[num].attrs = attribute;
try
{
FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
long length = fileStream.Length;
this.resources[num].data = new byte[length];
fileStream.Read(this.resources[num].data, 0, (int)length);
fileStream.Close();
}
catch
{
}
}
// Token: 0x060018AC RID: 6316 RVA: 0x0005E740 File Offset: 0x0005C940
internal void EmbedResource(string name, byte[] blob, ResourceAttributes attribute)
{
if (this.resources != null)
{
MonoResource[] array = new MonoResource[this.resources.Length + 1];
Array.Copy(this.resources, array, this.resources.Length);
this.resources = array;
}
else
{
this.resources = new MonoResource[1];
}
int num = this.resources.Length - 1;
this.resources[num].name = name;
this.resources[num].attrs = attribute;
this.resources[num].data = blob;
}
// Token: 0x060018AD RID: 6317 RVA: 0x0005E7D8 File Offset: 0x0005C9D8
internal void AddTypeForwarder(Type t)
{
if (t == null)
{
throw new ArgumentNullException("t");
}
if (this.type_forwarders == null)
{
this.type_forwarders = new Type[] { t };
}
else
{
Type[] array = new Type[this.type_forwarders.Length + 1];
Array.Copy(this.type_forwarders, array, this.type_forwarders.Length);
array[this.type_forwarders.Length] = t;
this.type_forwarders = array;
}
}
/// <summary>Defines a named transient dynamic module in this assembly.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.ModuleBuilder" /> representing the defined dynamic module.</returns>
/// <param name="name">The name of the dynamic module. Must be less than 260 characters in length. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> begins with white space.-or- The length of <paramref name="name" /> is zero.-or- The length of <paramref name="name" /> is greater than or equal to 260. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <exception cref="T:System.ExecutionEngineException">The assembly for default symbol writer cannot be loaded.-or- The type that implements the default symbol writer interface cannot be found. </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" />
/// </PermissionSet>
// Token: 0x060018AE RID: 6318 RVA: 0x0005E84C File Offset: 0x0005CA4C
public ModuleBuilder DefineDynamicModule(string name)
{
return this.DefineDynamicModule(name, name, false, true);
}
/// <summary>Defines a named transient dynamic module in this assembly and specifies whether symbol information should be emitted.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.ModuleBuilder" /> representing the defined dynamic module.</returns>
/// <param name="name">The name of the dynamic module. Must be less than 260 characters in length. </param>
/// <param name="emitSymbolInfo">true if symbol information is to be emitted; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> begins with white space.-or- The length of <paramref name="name" /> is zero.-or- The length of <paramref name="name" /> is greater than or equal to 260. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.ExecutionEngineException">The assembly for default symbol writer cannot be loaded.-or- The type that implements the default symbol writer interface cannot be found. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </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" />
/// </PermissionSet>
// Token: 0x060018AF RID: 6319 RVA: 0x0005E858 File Offset: 0x0005CA58
public ModuleBuilder DefineDynamicModule(string name, bool emitSymbolInfo)
{
return this.DefineDynamicModule(name, name, emitSymbolInfo, true);
}
/// <summary>Defines a persistable dynamic module with the given name that will be saved to the specified file. No symbol information is emitted.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.ModuleBuilder" /> object representing the defined dynamic module.</returns>
/// <param name="name">The name of the dynamic module. Must be less than 260 characters in length. </param>
/// <param name="fileName">The name of the file to which the dynamic module should be saved. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="fileName" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> or <paramref name="fileName" /> is zero.-or- The length of <paramref name="name" /> is greater than or equal to 260.-or- <paramref name="fileName" /> contains a path specification (a directory component, for example).-or- There is a conflict with the name of another file that belongs to this assembly. </exception>
/// <exception cref="T:System.InvalidOperationException">This assembly has been previously saved. </exception>
/// <exception cref="T:System.NotSupportedException">This assembly was called on a dynamic assembly with <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.Run" /> attribute. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <exception cref="T:System.ExecutionEngineException">The assembly for default symbol writer cannot be loaded.-or- The type that implements the default symbol writer interface cannot be found. </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" />
/// </PermissionSet>
// Token: 0x060018B0 RID: 6320 RVA: 0x0005E864 File Offset: 0x0005CA64
public ModuleBuilder DefineDynamicModule(string name, string fileName)
{
return this.DefineDynamicModule(name, fileName, false, false);
}
/// <summary>Defines a persistable dynamic module, specifying the module name, the name of the file to which the module will be saved, and whether symbol information should be emitted using the default symbol writer.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.ModuleBuilder" /> object representing the defined dynamic module.</returns>
/// <param name="name">The name of the dynamic module. Must be less than 260 characters in length. </param>
/// <param name="fileName">The name of the file to which the dynamic module should be saved. </param>
/// <param name="emitSymbolInfo">If true, symbolic information is written using the default symbol writer. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="fileName" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> or <paramref name="fileName" /> is zero.-or- The length of <paramref name="name" /> is greater than or equal to 260.-or- <paramref name="fileName" /> contains a path specification (a directory component, for example).-or- There is a conflict with the name of another file that belongs to this assembly. </exception>
/// <exception cref="T:System.InvalidOperationException">This assembly has been previously saved. </exception>
/// <exception cref="T:System.NotSupportedException">This assembly was called on a dynamic assembly with the <see cref="F:System.Reflection.Emit.AssemblyBuilderAccess.Run" /> attribute. </exception>
/// <exception cref="T:System.ExecutionEngineException">The assembly for default symbol writer cannot be loaded.-or- The type that implements the default symbol writer interface cannot be found. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </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" />
/// </PermissionSet>
// Token: 0x060018B1 RID: 6321 RVA: 0x0005E870 File Offset: 0x0005CA70
public ModuleBuilder DefineDynamicModule(string name, string fileName, bool emitSymbolInfo)
{
return this.DefineDynamicModule(name, fileName, emitSymbolInfo, false);
}
// Token: 0x060018B2 RID: 6322 RVA: 0x0005E87C File Offset: 0x0005CA7C
private ModuleBuilder DefineDynamicModule(string name, string fileName, bool emitSymbolInfo, bool transient)
{
this.check_name_and_filename(name, fileName, false);
if (!transient)
{
if (Path.GetExtension(fileName) == string.Empty)
{
throw new ArgumentException("Module file name '" + fileName + "' must have file extension.");
}
if (!this.IsSave)
{
throw new NotSupportedException("Persistable modules are not supported in a dynamic assembly created with AssemblyBuilderAccess.Run");
}
if (this.created)
{
throw new InvalidOperationException("Assembly was already saved.");
}
}
ModuleBuilder moduleBuilder = new ModuleBuilder(this, name, fileName, emitSymbolInfo, transient);
if (this.modules != null && this.is_module_only)
{
throw new InvalidOperationException("A module-only assembly can only contain one module.");
}
if (this.modules != null)
{
ModuleBuilder[] array = new ModuleBuilder[this.modules.Length + 1];
Array.Copy(this.modules, array, this.modules.Length);
this.modules = array;
}
else
{
this.modules = new ModuleBuilder[1];
}
this.modules[this.modules.Length - 1] = moduleBuilder;
return moduleBuilder;
}
// Token: 0x060018B3 RID: 6323
[MethodImpl(MethodImplOptions.InternalCall)]
private extern Module InternalAddModule(string fileName);
// Token: 0x060018B4 RID: 6324 RVA: 0x0005E978 File Offset: 0x0005CB78
internal Module AddModule(string fileName)
{
if (fileName == null)
{
throw new ArgumentNullException(fileName);
}
Module module = this.InternalAddModule(fileName);
if (this.loaded_modules != null)
{
Module[] array = new Module[this.loaded_modules.Length + 1];
Array.Copy(this.loaded_modules, array, this.loaded_modules.Length);
this.loaded_modules = array;
}
else
{
this.loaded_modules = new Module[1];
}
this.loaded_modules[this.loaded_modules.Length - 1] = module;
return module;
}
/// <summary>Defines a standalone managed resource for this assembly with the default public resource attribute.</summary>
/// <returns>A <see cref="T:System.Resources.ResourceWriter" /> object for the specified resource.</returns>
/// <param name="name">The logical name of the resource. </param>
/// <param name="description">A textual description of the resource. </param>
/// <param name="fileName">The physical file name (.resources file) to which the logical name is mapped. This should not include a path. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> has been previously defined.-or- There is another file in the assembly named <paramref name="fileName" />.-or- The length of <paramref name="name" /> is zero.-or- The length of <paramref name="fileName" /> is zero.-or- <paramref name="fileName" /> includes a path. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="fileName" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018B5 RID: 6325 RVA: 0x0005E9F4 File Offset: 0x0005CBF4
public IResourceWriter DefineResource(string name, string description, string fileName)
{
return this.DefineResource(name, description, fileName, ResourceAttributes.Public);
}
/// <summary>Defines a standalone managed resource for this assembly. Attributes can be specified for the managed resource.</summary>
/// <returns>A <see cref="T:System.Resources.ResourceWriter" /> object for the specified resource.</returns>
/// <param name="name">The logical name of the resource. </param>
/// <param name="description">A textual description of the resource. </param>
/// <param name="fileName">The physical file name (.resources file) to which the logical name is mapped. This should not include a path. </param>
/// <param name="attribute">The resource attributes. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> has been previously defined or if there is another file in the assembly named <paramref name="fileName" />.-or- The length of <paramref name="name" /> is zero.-or- The length of <paramref name="fileName" /> is zero.-or- <paramref name="fileName" /> includes a path. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="fileName" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018B6 RID: 6326 RVA: 0x0005EA00 File Offset: 0x0005CC00
public IResourceWriter DefineResource(string name, string description, string fileName, ResourceAttributes attribute)
{
this.AddResourceFile(name, fileName, attribute, false);
IResourceWriter resourceWriter = new ResourceWriter(fileName);
if (this.resource_writers == null)
{
this.resource_writers = new ArrayList();
}
this.resource_writers.Add(resourceWriter);
return resourceWriter;
}
// Token: 0x060018B7 RID: 6327 RVA: 0x0005EA44 File Offset: 0x0005CC44
private void AddUnmanagedResource(Win32Resource res)
{
MemoryStream memoryStream = new MemoryStream();
res.WriteTo(memoryStream);
if (this.win32_resources != null)
{
MonoWin32Resource[] array = new MonoWin32Resource[this.win32_resources.Length + 1];
Array.Copy(this.win32_resources, array, this.win32_resources.Length);
this.win32_resources = array;
}
else
{
this.win32_resources = new MonoWin32Resource[1];
}
this.win32_resources[this.win32_resources.Length - 1] = new MonoWin32Resource(res.Type.Id, res.Name.Id, res.Language, memoryStream.ToArray());
}
/// <summary>Defines an unmanaged resource for this assembly as an opaque blob of bytes.</summary>
/// <param name="resource">The opaque blob of bytes representing the unmanaged resource. </param>
/// <exception cref="T:System.ArgumentException">An unmanaged resource was previously defined. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="resource" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018B8 RID: 6328 RVA: 0x0005EAE8 File Offset: 0x0005CCE8
[MonoTODO("Not currently implemenented")]
public void DefineUnmanagedResource(byte[] resource)
{
if (resource == null)
{
throw new ArgumentNullException("resource");
}
if (this.native_resource != NativeResourceType.None)
{
throw new ArgumentException("Native resource has already been defined.");
}
this.native_resource = NativeResourceType.Unmanaged;
throw new NotImplementedException();
}
/// <summary>Defines an unmanaged resource file for this assembly given the name of the resource file.</summary>
/// <param name="resourceFileName">The name of the resource file. </param>
/// <exception cref="T:System.ArgumentException">An unmanaged resource was previously defined.-or- The file <paramref name="resourceFileName" /> is not readable.-or- <paramref name="resourceFileName" /> is the empty string (""). </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="resourceFileName" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="resourceFileName" /> is not found.-or- <paramref name="resourceFileName" /> is a directory. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018B9 RID: 6329 RVA: 0x0005EB20 File Offset: 0x0005CD20
public void DefineUnmanagedResource(string resourceFileName)
{
if (resourceFileName == null)
{
throw new ArgumentNullException("resourceFileName");
}
if (resourceFileName.Length == 0)
{
throw new ArgumentException("resourceFileName");
}
if (!File.Exists(resourceFileName) || Directory.Exists(resourceFileName))
{
throw new FileNotFoundException("File '" + resourceFileName + "' does not exists or is a directory.");
}
if (this.native_resource != NativeResourceType.None)
{
throw new ArgumentException("Native resource has already been defined.");
}
this.native_resource = NativeResourceType.Unmanaged;
using (FileStream fileStream = new FileStream(resourceFileName, FileMode.Open, FileAccess.Read))
{
Win32ResFileReader win32ResFileReader = new Win32ResFileReader(fileStream);
foreach (object obj in win32ResFileReader.ReadResources())
{
Win32EncodedResource win32EncodedResource = (Win32EncodedResource)obj;
if (win32EncodedResource.Name.IsName || win32EncodedResource.Type.IsName)
{
throw new InvalidOperationException("resource files with named resources or non-default resource types are not supported.");
}
this.AddUnmanagedResource(win32EncodedResource);
}
}
}
/// <summary>Defines an unmanaged version information resource using the information specified in the assembly's AssemblyName object and the assembly's custom attributes.</summary>
/// <exception cref="T:System.ArgumentException">An unmanaged version information resource was previously defined.-or- The unmanaged version information is too large to persist. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018BA RID: 6330 RVA: 0x0005EC68 File Offset: 0x0005CE68
public void DefineVersionInfoResource()
{
if (this.native_resource != NativeResourceType.None)
{
throw new ArgumentException("Native resource has already been defined.");
}
this.native_resource = NativeResourceType.Assembly;
this.version_res = new Win32VersionResource(1, 0, this.IsCompilerContext);
}
/// <summary>Defines an unmanaged version information resource for this assembly with the given specifications.</summary>
/// <param name="product">The name of the product with which this assembly is distributed. </param>
/// <param name="productVersion">The version of the product with which this assembly is distributed. </param>
/// <param name="company">The name of the company that produced this assembly. </param>
/// <param name="copyright">Describes all copyright notices, trademarks, and registered trademarks that apply to this assembly. This should include the full text of all notices, legal symbols, copyright dates, trademark numbers, and so on. In English, this string should be in the format "Copyright Microsoft Corp. 1990-2001". </param>
/// <param name="trademark">Describes all trademarks and registered trademarks that apply to this assembly. This should include the full text of all notices, legal symbols, trademark numbers, and so on. In English, this string should be in the format "Windows is a trademark of Microsoft Corporation". </param>
/// <exception cref="T:System.ArgumentException">An unmanaged version information resource was previously defined.-or- The unmanaged version information is too large to persist. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018BB RID: 6331 RVA: 0x0005ECA8 File Offset: 0x0005CEA8
public void DefineVersionInfoResource(string product, string productVersion, string company, string copyright, string trademark)
{
if (this.native_resource != NativeResourceType.None)
{
throw new ArgumentException("Native resource has already been defined.");
}
this.native_resource = NativeResourceType.Explicit;
this.version_res = new Win32VersionResource(1, 0, false);
this.version_res.ProductName = ((product == null) ? " " : product);
this.version_res.ProductVersion = ((productVersion == null) ? " " : productVersion);
this.version_res.CompanyName = ((company == null) ? " " : company);
this.version_res.LegalCopyright = ((copyright == null) ? " " : copyright);
this.version_res.LegalTrademarks = ((trademark == null) ? " " : trademark);
}
// Token: 0x060018BC RID: 6332 RVA: 0x0005ED70 File Offset: 0x0005CF70
internal void DefineIconResource(string iconFileName)
{
if (iconFileName == null)
{
throw new ArgumentNullException("iconFileName");
}
if (iconFileName.Length == 0)
{
throw new ArgumentException("iconFileName");
}
if (!File.Exists(iconFileName) || Directory.Exists(iconFileName))
{
throw new FileNotFoundException("File '" + iconFileName + "' does not exists or is a directory.");
}
using (FileStream fileStream = new FileStream(iconFileName, FileMode.Open, FileAccess.Read))
{
Win32IconFileReader win32IconFileReader = new Win32IconFileReader(fileStream);
ICONDIRENTRY[] array = win32IconFileReader.ReadIcons();
Win32IconResource[] array2 = new Win32IconResource[array.Length];
for (int i = 0; i < array.Length; i++)
{
array2[i] = new Win32IconResource(i + 1, 0, array[i]);
this.AddUnmanagedResource(array2[i]);
}
Win32GroupIconResource win32GroupIconResource = new Win32GroupIconResource(1, 0, array2);
this.AddUnmanagedResource(win32GroupIconResource);
}
}
// Token: 0x060018BD RID: 6333 RVA: 0x0005EE64 File Offset: 0x0005D064
private void DefineVersionInfoResourceImpl(string fileName)
{
if (this.versioninfo_culture != null)
{
this.version_res.FileLanguage = new CultureInfo(this.versioninfo_culture).LCID;
}
this.version_res.Version = ((this.version != null) ? this.version : "0.0.0.0");
if (this.cattrs != null)
{
NativeResourceType nativeResourceType = this.native_resource;
if (nativeResourceType != NativeResourceType.Assembly)
{
if (nativeResourceType == NativeResourceType.Explicit)
{
foreach (CustomAttributeBuilder customAttributeBuilder in this.cattrs)
{
string fullName = customAttributeBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Reflection.AssemblyCultureAttribute")
{
if (!this.IsCompilerContext)
{
this.version_res.FileLanguage = new CultureInfo(customAttributeBuilder.string_arg()).LCID;
}
}
else if (fullName == "System.Reflection.AssemblyDescriptionAttribute")
{
this.version_res.Comments = customAttributeBuilder.string_arg();
}
}
}
}
else
{
foreach (CustomAttributeBuilder customAttributeBuilder2 in this.cattrs)
{
string fullName2 = customAttributeBuilder2.Ctor.ReflectedType.FullName;
if (fullName2 == "System.Reflection.AssemblyProductAttribute")
{
this.version_res.ProductName = customAttributeBuilder2.string_arg();
}
else if (fullName2 == "System.Reflection.AssemblyCompanyAttribute")
{
this.version_res.CompanyName = customAttributeBuilder2.string_arg();
}
else if (fullName2 == "System.Reflection.AssemblyCopyrightAttribute")
{
this.version_res.LegalCopyright = customAttributeBuilder2.string_arg();
}
else if (fullName2 == "System.Reflection.AssemblyTrademarkAttribute")
{
this.version_res.LegalTrademarks = customAttributeBuilder2.string_arg();
}
else if (fullName2 == "System.Reflection.AssemblyCultureAttribute")
{
if (!this.IsCompilerContext)
{
this.version_res.FileLanguage = new CultureInfo(customAttributeBuilder2.string_arg()).LCID;
}
}
else if (fullName2 == "System.Reflection.AssemblyFileVersionAttribute")
{
string text = customAttributeBuilder2.string_arg();
if (!this.IsCompilerContext || (text != null && text.Length != 0))
{
this.version_res.FileVersion = text;
}
}
else if (fullName2 == "System.Reflection.AssemblyInformationalVersionAttribute")
{
this.version_res.ProductVersion = customAttributeBuilder2.string_arg();
}
else if (fullName2 == "System.Reflection.AssemblyTitleAttribute")
{
this.version_res.FileDescription = customAttributeBuilder2.string_arg();
}
else if (fullName2 == "System.Reflection.AssemblyDescriptionAttribute")
{
this.version_res.Comments = customAttributeBuilder2.string_arg();
}
}
}
}
this.version_res.OriginalFilename = fileName;
if (this.IsCompilerContext)
{
this.version_res.InternalName = fileName;
if (this.version_res.ProductVersion.Trim().Length == 0)
{
this.version_res.ProductVersion = this.version_res.FileVersion;
}
}
else
{
this.version_res.InternalName = Path.GetFileNameWithoutExtension(fileName);
}
this.AddUnmanagedResource(this.version_res);
}
/// <summary>Returns the dynamic module with the specified name.</summary>
/// <returns>A ModuleBuilder object representing the requested dynamic module.</returns>
/// <param name="name">The name of the requested dynamic module. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018BE RID: 6334 RVA: 0x0005F1B8 File Offset: 0x0005D3B8
public ModuleBuilder GetDynamicModule(string name)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name.Length == 0)
{
throw new ArgumentException("Empty name is not legal.", "name");
}
if (this.modules != null)
{
for (int i = 0; i < this.modules.Length; i++)
{
if (this.modules[i].name == name)
{
return this.modules[i];
}
}
}
return null;
}
/// <summary>Gets the exported types defined in this assembly.</summary>
/// <returns>An array of <see cref="T:System.Type" /> containing the exported types defined in this assembly.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not implemented. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018BF RID: 6335 RVA: 0x0005F238 File Offset: 0x0005D438
public override Type[] GetExportedTypes()
{
throw this.not_supported();
}
/// <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. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018C0 RID: 6336 RVA: 0x0005F240 File Offset: 0x0005D440
public override FileStream GetFile(string name)
{
throw this.not_supported();
}
/// <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.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018C1 RID: 6337 RVA: 0x0005F248 File Offset: 0x0005D448
public override FileStream[] GetFiles(bool getResourceModules)
{
throw this.not_supported();
}
// Token: 0x060018C2 RID: 6338 RVA: 0x0005F250 File Offset: 0x0005D450
internal override Module[] GetModulesInternal()
{
if (this.modules == null)
{
return new Module[0];
}
return (Module[])this.modules.Clone();
}
// Token: 0x060018C3 RID: 6339 RVA: 0x0005F280 File Offset: 0x0005D480
internal override Type[] GetTypes(bool exportedOnly)
{
Type[] array = null;
if (this.modules != null)
{
for (int i = 0; i < this.modules.Length; i++)
{
Type[] types = this.modules[i].GetTypes();
if (array == null)
{
array = types;
}
else
{
Type[] array2 = new Type[array.Length + types.Length];
Array.Copy(array, 0, array2, 0, array.Length);
Array.Copy(types, 0, array2, array.Length, types.Length);
}
}
}
if (this.loaded_modules != null)
{
for (int j = 0; j < this.loaded_modules.Length; j++)
{
Type[] types2 = this.loaded_modules[j].GetTypes();
if (array == null)
{
array = types2;
}
else
{
Type[] array3 = new Type[array.Length + types2.Length];
Array.Copy(array, 0, array3, 0, array.Length);
Array.Copy(types2, 0, array3, array.Length, types2.Length);
}
}
}
return (array != null) ? array : Type.EmptyTypes;
}
/// <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 name of the resource. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018C4 RID: 6340 RVA: 0x0005F37C File Offset: 0x0005D57C
public override ManifestResourceInfo GetManifestResourceInfo(string resourceName)
{
throw this.not_supported();
}
/// <summary>Loads the specified manifest resource from this assembly.</summary>
/// <returns>An array of type String containing the names of all the resources.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not supported on a dynamic assembly. To get the manifest resource names, use <see cref="M:System.Reflection.Assembly.GetManifestResourceNames" />. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018C5 RID: 6341 RVA: 0x0005F384 File Offset: 0x0005D584
public override string[] GetManifestResourceNames()
{
throw this.not_supported();
}
/// <summary>Loads the specified manifest resource from this assembly.</summary>
/// <returns>A <see cref="T:System.IO.Stream" /> representing this manifest resource.</returns>
/// <param name="name">The name of the manifest resource being requested. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018C6 RID: 6342 RVA: 0x0005F38C File Offset: 0x0005D58C
public override Stream GetManifestResourceStream(string name)
{
throw this.not_supported();
}
/// <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 this manifest resource.</returns>
/// <param name="type">The type whose namespace is used to scope the manifest resource name. </param>
/// <param name="name">The name of the manifest resource being requested. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018C7 RID: 6343 RVA: 0x0005F394 File Offset: 0x0005D594
public override Stream GetManifestResourceStream(Type type, string name)
{
throw this.not_supported();
}
// Token: 0x1700044F RID: 1103
// (get) Token: 0x060018C8 RID: 6344 RVA: 0x0005F39C File Offset: 0x0005D59C
internal bool IsCompilerContext
{
get
{
return this.is_compiler_context;
}
}
// Token: 0x17000450 RID: 1104
// (get) Token: 0x060018C9 RID: 6345 RVA: 0x0005F3A4 File Offset: 0x0005D5A4
internal bool IsSave
{
get
{
return this.access != 1U;
}
}
// Token: 0x17000451 RID: 1105
// (get) Token: 0x060018CA RID: 6346 RVA: 0x0005F3B4 File Offset: 0x0005D5B4
internal bool IsRun
{
get
{
return this.access == 1U || this.access == 3U;
}
}
// Token: 0x17000452 RID: 1106
// (get) Token: 0x060018CB RID: 6347 RVA: 0x0005F3D0 File Offset: 0x0005D5D0
internal string AssemblyDir
{
get
{
return this.dir;
}
}
// Token: 0x17000453 RID: 1107
// (get) Token: 0x060018CC RID: 6348 RVA: 0x0005F3D8 File Offset: 0x0005D5D8
// (set) Token: 0x060018CD RID: 6349 RVA: 0x0005F3E0 File Offset: 0x0005D5E0
internal bool IsModuleOnly
{
get
{
return this.is_module_only;
}
set
{
this.is_module_only = value;
}
}
// Token: 0x060018CE RID: 6350 RVA: 0x0005F3EC File Offset: 0x0005D5EC
internal override Module GetManifestModule()
{
if (this.manifest_module == null)
{
this.manifest_module = this.DefineDynamicModule("Default Dynamic Module");
}
return this.manifest_module;
}
/// <summary>Saves this dynamic assembly to disk, specifying the nature of code in the assembly's executables and the target platform.</summary>
/// <param name="assemblyFileName">The file name of the assembly.</param>
/// <param name="portableExecutableKind">A bitwise combination of the <see cref="T:System.Reflection.PortableExecutableKinds" /> values that specifies the nature of the code.</param>
/// <param name="imageFileMachine">One of the <see cref="T:System.Reflection.ImageFileMachine" /> values that specifies the target platform.</param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="assemblyFileName" /> is 0.-or- There are two or more modules resource files in the assembly with the same name.-or- The target directory of the assembly is invalid.-or- <paramref name="assemblyFileName" /> is not a simple file name (for example, has a directory or drive component), or more than one unmanaged resource, including a version information resources, was defined in this assembly.-or- The CultureInfo string in <see cref="T:System.Reflection.AssemblyCultureAttribute" /> is not a valid string and <see cref="M:System.Reflection.Emit.AssemblyBuilder.DefineVersionInfoResource(System.String,System.String,System.String,System.String,System.String)" /> was called prior to calling this method. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyFileName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">This assembly has been saved before.-or- This assembly has access Run<see cref="T:System.Reflection.Emit.AssemblyBuilderAccess" />. </exception>
/// <exception cref="T:System.IO.IOException">An output error occurs during the save. </exception>
/// <exception cref="T:System.NotSupportedException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has not been called for any of the types in the modules of the assembly to be written to disk. </exception>
// Token: 0x060018CF RID: 6351 RVA: 0x0005F41C File Offset: 0x0005D61C
[MonoLimitation("No support for PE32+ assemblies for AMD64 and IA64")]
public void Save(string assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
{
this.peKind = portableExecutableKind;
this.machine = imageFileMachine;
if ((this.peKind & PortableExecutableKinds.PE32Plus) != PortableExecutableKinds.NotAPortableExecutableImage || (this.peKind & PortableExecutableKinds.Unmanaged32Bit) != PortableExecutableKinds.NotAPortableExecutableImage)
{
throw new NotImplementedException(this.peKind.ToString());
}
if (this.machine == ImageFileMachine.IA64 || this.machine == ImageFileMachine.AMD64)
{
throw new NotImplementedException(this.machine.ToString());
}
if (this.resource_writers != null)
{
foreach (object obj in this.resource_writers)
{
IResourceWriter resourceWriter = (IResourceWriter)obj;
resourceWriter.Generate();
resourceWriter.Close();
}
}
ModuleBuilder moduleBuilder = null;
if (this.modules != null)
{
foreach (ModuleBuilder moduleBuilder2 in this.modules)
{
if (moduleBuilder2.FullyQualifiedName == assemblyFileName)
{
moduleBuilder = moduleBuilder2;
}
}
}
if (moduleBuilder == null)
{
moduleBuilder = this.DefineDynamicModule("RefEmit_OnDiskManifestModule", assemblyFileName);
}
if (!this.is_module_only)
{
moduleBuilder.IsMain = true;
}
if (this.entry_point != null && this.entry_point.DeclaringType.Module != moduleBuilder)
{
Type[] array2;
if (this.entry_point.GetParameters().Length == 1)
{
array2 = new Type[] { typeof(string) };
}
else
{
array2 = Type.EmptyTypes;
}
MethodBuilder methodBuilder = moduleBuilder.DefineGlobalMethod("__EntryPoint$", MethodAttributes.Static, this.entry_point.ReturnType, array2);
ILGenerator ilgenerator = methodBuilder.GetILGenerator();
if (array2.Length == 1)
{
ilgenerator.Emit(OpCodes.Ldarg_0);
}
ilgenerator.Emit(OpCodes.Tailcall);
ilgenerator.Emit(OpCodes.Call, this.entry_point);
ilgenerator.Emit(OpCodes.Ret);
this.entry_point = methodBuilder;
}
if (this.version_res != null)
{
this.DefineVersionInfoResourceImpl(assemblyFileName);
}
if (this.sn != null)
{
this.public_key = this.sn.PublicKey;
}
foreach (ModuleBuilder moduleBuilder3 in this.modules)
{
if (moduleBuilder3 != moduleBuilder)
{
moduleBuilder3.Save();
}
}
moduleBuilder.Save();
if (this.sn != null && this.sn.CanSign)
{
this.sn.Sign(Path.Combine(this.AssemblyDir, assemblyFileName));
}
this.created = true;
}
/// <summary>Saves this dynamic assembly to disk.</summary>
/// <param name="assemblyFileName">The file name of the assembly. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="assemblyFileName" /> is 0.-or- There are two or more modules resource files in the assembly with the same name.-or- The target directory of the assembly is invalid.-or- <paramref name="assemblyFileName" /> is not a simple file name (for example, has a directory or drive component), or more than one unmanaged resource, including a version information resource, was defined in this assembly.-or- The CultureInfo string in <see cref="T:System.Reflection.AssemblyCultureAttribute" /> is not a valid string and <see cref="M:System.Reflection.Emit.AssemblyBuilder.DefineVersionInfoResource(System.String,System.String,System.String,System.String,System.String)" /> was called prior to calling this method. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="assemblyFileName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">This assembly has been saved before.-or- This assembly has access Run<see cref="T:System.Reflection.Emit.AssemblyBuilderAccess" /></exception>
/// <exception cref="T:System.IO.IOException">An output error occurs during the save. </exception>
/// <exception cref="T:System.NotSupportedException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has not been called for any of the types in the modules of the assembly to be written to disk. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x060018D0 RID: 6352 RVA: 0x0005F6E8 File Offset: 0x0005D8E8
public void Save(string assemblyFileName)
{
this.Save(assemblyFileName, PortableExecutableKinds.ILOnly, ImageFileMachine.I386);
}
/// <summary>Sets the entry point for this dynamic assembly, assuming that a console application is being built.</summary>
/// <param name="entryMethod">A reference to the method that represents the entry point for this dynamic assembly. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="entryMethod" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="entryMethod" /> is not contained within this assembly. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018D1 RID: 6353 RVA: 0x0005F6F8 File Offset: 0x0005D8F8
public void SetEntryPoint(MethodInfo entryMethod)
{
this.SetEntryPoint(entryMethod, PEFileKinds.ConsoleApplication);
}
/// <summary>Sets the entry point for this assembly and defines the type of the portable executable (PE file) being built.</summary>
/// <param name="entryMethod">A reference to the method that represents the entry point for this dynamic assembly. </param>
/// <param name="fileKind">The type of the assembly executable being built. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="entryMethod" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="entryMethod" /> is not contained within this assembly. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018D2 RID: 6354 RVA: 0x0005F704 File Offset: 0x0005D904
public void SetEntryPoint(MethodInfo entryMethod, PEFileKinds fileKind)
{
if (entryMethod == null)
{
throw new ArgumentNullException("entryMethod");
}
if (entryMethod.DeclaringType.Assembly != this)
{
throw new InvalidOperationException("Entry method is not defined in the same assembly.");
}
this.entry_point = entryMethod;
this.pekind = fileKind;
}
/// <summary>Set a custom attribute on this assembly using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x060018D3 RID: 6355 RVA: 0x0005F744 File Offset: 0x0005D944
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
if (this.IsCompilerContext)
{
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Reflection.AssemblyVersionAttribute")
{
this.version = this.create_assembly_version(customBuilder.string_arg());
return;
}
if (fullName == "System.Reflection.AssemblyCultureAttribute")
{
this.culture = this.GetCultureString(customBuilder.string_arg());
}
else if (fullName == "System.Reflection.AssemblyAlgorithmIdAttribute")
{
byte[] array = customBuilder.Data;
int num = 2;
this.algid = (uint)array[num];
this.algid |= (uint)((uint)array[num + 1] << 8);
this.algid |= (uint)((uint)array[num + 2] << 16);
this.algid |= (uint)((uint)array[num + 3] << 24);
}
else if (fullName == "System.Reflection.AssemblyFlagsAttribute")
{
byte[] array = customBuilder.Data;
int num = 2;
this.flags |= (uint)array[num];
this.flags |= (uint)((uint)array[num + 1] << 8);
this.flags |= (uint)((uint)array[num + 2] << 16);
this.flags |= (uint)((uint)array[num + 3] << 24);
if (this.sn == null)
{
this.flags &= 4294967294U;
}
}
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array2 = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array2, 0);
array2[this.cattrs.Length] = customBuilder;
this.cattrs = array2;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Set a custom attribute on this assembly using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="con" /> is not a RuntimeConstructorInfo.</exception>
// Token: 0x060018D4 RID: 6356 RVA: 0x0005F904 File Offset: 0x0005DB04
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
if (con == null)
{
throw new ArgumentNullException("con");
}
if (binaryAttribute == null)
{
throw new ArgumentNullException("binaryAttribute");
}
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
// Token: 0x060018D5 RID: 6357 RVA: 0x0005F938 File Offset: 0x0005DB38
internal void SetCorlibTypeBuilders(Type corlib_object_type, Type corlib_value_type, Type corlib_enum_type)
{
this.corlib_object_type = corlib_object_type;
this.corlib_value_type = corlib_value_type;
this.corlib_enum_type = corlib_enum_type;
}
// Token: 0x060018D6 RID: 6358 RVA: 0x0005F950 File Offset: 0x0005DB50
internal void SetCorlibTypeBuilders(Type corlib_object_type, Type corlib_value_type, Type corlib_enum_type, Type corlib_void_type)
{
this.SetCorlibTypeBuilders(corlib_object_type, corlib_value_type, corlib_enum_type);
this.corlib_void_type = corlib_void_type;
}
// Token: 0x060018D7 RID: 6359 RVA: 0x0005F964 File Offset: 0x0005DB64
private Exception not_supported()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
// Token: 0x060018D8 RID: 6360 RVA: 0x0005F970 File Offset: 0x0005DB70
private void check_name_and_filename(string name, string fileName, bool fileNeedsToExists)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (fileName == null)
{
throw new ArgumentNullException("fileName");
}
if (name.Length == 0)
{
throw new ArgumentException("Empty name is not legal.", "name");
}
if (fileName.Length == 0)
{
throw new ArgumentException("Empty file name is not legal.", "fileName");
}
if (Path.GetFileName(fileName) != fileName)
{
throw new ArgumentException("fileName '" + fileName + "' must not include a path.", "fileName");
}
string text = fileName;
if (this.dir != null)
{
text = Path.Combine(this.dir, fileName);
}
if (fileNeedsToExists && !File.Exists(text))
{
throw new FileNotFoundException("Could not find file '" + fileName + "'");
}
if (this.resources != null)
{
for (int i = 0; i < this.resources.Length; i++)
{
if (this.resources[i].filename == text)
{
throw new ArgumentException("Duplicate file name '" + fileName + "'");
}
if (this.resources[i].name == name)
{
throw new ArgumentException("Duplicate name '" + name + "'");
}
}
}
if (this.modules != null)
{
for (int j = 0; j < this.modules.Length; j++)
{
if (!this.modules[j].IsTransient() && this.modules[j].FileName == fileName)
{
throw new ArgumentException("Duplicate file name '" + fileName + "'");
}
if (this.modules[j].Name == name)
{
throw new ArgumentException("Duplicate name '" + name + "'");
}
}
}
}
// Token: 0x060018D9 RID: 6361 RVA: 0x0005FB5C File Offset: 0x0005DD5C
private string create_assembly_version(string version)
{
string[] array = version.Split(new char[] { '.' });
int[] array2 = new int[4];
if (array.Length < 0 || array.Length > 4)
{
throw new ArgumentException("The version specified '" + version + "' is invalid");
}
for (int i = 0; i < array.Length; i++)
{
if (array[i] == "*")
{
DateTime now = DateTime.Now;
if (i == 2)
{
array2[2] = (now - new DateTime(2000, 1, 1)).Days;
if (array.Length == 3)
{
array2[3] = (now.Second + now.Minute * 60 + now.Hour * 3600) / 2;
}
}
else
{
if (i != 3)
{
throw new ArgumentException("The version specified '" + version + "' is invalid");
}
array2[3] = (now.Second + now.Minute * 60 + now.Hour * 3600) / 2;
}
}
else
{
try
{
array2[i] = int.Parse(array[i]);
}
catch (FormatException)
{
throw new ArgumentException("The version specified '" + version + "' is invalid");
}
}
}
return string.Concat(new object[]
{
array2[0],
".",
array2[1],
".",
array2[2],
".",
array2[3]
});
}
// Token: 0x060018DA RID: 6362 RVA: 0x0005FD14 File Offset: 0x0005DF14
private string GetCultureString(string str)
{
return (!(str == "neutral")) ? str : string.Empty;
}
// Token: 0x060018DB RID: 6363 RVA: 0x0005FD34 File Offset: 0x0005DF34
internal override AssemblyName UnprotectedGetName()
{
AssemblyName assemblyName = base.UnprotectedGetName();
if (this.sn != null)
{
assemblyName.SetPublicKey(this.sn.PublicKey);
assemblyName.SetPublicKeyToken(this.sn.PublicKeyToken);
}
return assemblyName;
}
// Token: 0x04000745 RID: 1861
private const AssemblyBuilderAccess COMPILER_ACCESS = (AssemblyBuilderAccess)2048;
// Token: 0x04000746 RID: 1862
private UIntPtr dynamic_assembly;
// Token: 0x04000747 RID: 1863
private MethodInfo entry_point;
// Token: 0x04000748 RID: 1864
private ModuleBuilder[] modules;
// Token: 0x04000749 RID: 1865
private string name;
// Token: 0x0400074A RID: 1866
private string dir;
// Token: 0x0400074B RID: 1867
private CustomAttributeBuilder[] cattrs;
// Token: 0x0400074C RID: 1868
private MonoResource[] resources;
// Token: 0x0400074D RID: 1869
private byte[] public_key;
// Token: 0x0400074E RID: 1870
private string version;
// Token: 0x0400074F RID: 1871
private string culture;
// Token: 0x04000750 RID: 1872
private uint algid;
// Token: 0x04000751 RID: 1873
private uint flags;
// Token: 0x04000752 RID: 1874
private PEFileKinds pekind = PEFileKinds.Dll;
// Token: 0x04000753 RID: 1875
private bool delay_sign;
// Token: 0x04000754 RID: 1876
private uint access;
// Token: 0x04000755 RID: 1877
private Module[] loaded_modules;
// Token: 0x04000756 RID: 1878
private MonoWin32Resource[] win32_resources;
// Token: 0x04000757 RID: 1879
private RefEmitPermissionSet[] permissions_minimum;
// Token: 0x04000758 RID: 1880
private RefEmitPermissionSet[] permissions_optional;
// Token: 0x04000759 RID: 1881
private RefEmitPermissionSet[] permissions_refused;
// Token: 0x0400075A RID: 1882
private PortableExecutableKinds peKind;
// Token: 0x0400075B RID: 1883
private ImageFileMachine machine;
// Token: 0x0400075C RID: 1884
private bool corlib_internal;
// Token: 0x0400075D RID: 1885
private Type[] type_forwarders;
// Token: 0x0400075E RID: 1886
private byte[] pktoken;
// Token: 0x0400075F RID: 1887
internal Type corlib_object_type = typeof(object);
// Token: 0x04000760 RID: 1888
internal Type corlib_value_type = typeof(ValueType);
// Token: 0x04000761 RID: 1889
internal Type corlib_enum_type = typeof(Enum);
// Token: 0x04000762 RID: 1890
internal Type corlib_void_type = typeof(void);
// Token: 0x04000763 RID: 1891
private ArrayList resource_writers;
// Token: 0x04000764 RID: 1892
private Win32VersionResource version_res;
// Token: 0x04000765 RID: 1893
private bool created;
// Token: 0x04000766 RID: 1894
private bool is_module_only;
// Token: 0x04000767 RID: 1895
private StrongName sn;
// Token: 0x04000768 RID: 1896
private NativeResourceType native_resource;
// Token: 0x04000769 RID: 1897
private readonly bool is_compiler_context;
// Token: 0x0400076A RID: 1898
private string versioninfo_culture;
// Token: 0x0400076B RID: 1899
private ModuleBuilder manifest_module;
}
}
@@ -0,0 +1,26 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines the access modes for a dynamic assembly.</summary>
// Token: 0x020001E1 RID: 481
[ComVisible(true)]
[Flags]
[Serializable]
public enum AssemblyBuilderAccess
{
/// <summary>Represents that the dynamic assembly can be executed, but not saved.</summary>
// Token: 0x0400076D RID: 1901
Run = 1,
/// <summary>Represents that the dynamic assembly can be saved, but not executed.</summary>
// Token: 0x0400076E RID: 1902
Save = 2,
/// <summary>Represents that the dynamic assembly can be executed and saved.</summary>
// Token: 0x0400076F RID: 1903
RunAndSave = 3,
/// <summary>Represents that the dynamic assembly is loaded into the reflection-only context, and cannot be executed.</summary>
// Token: 0x04000770 RID: 1904
ReflectionOnly = 6
}
}
@@ -0,0 +1,64 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001E9 RID: 489
internal class ByRefType : DerivedType
{
// Token: 0x0600196C RID: 6508 RVA: 0x000617A4 File Offset: 0x0005F9A4
internal ByRefType(Type elementType)
: base(elementType)
{
}
// Token: 0x0600196D RID: 6509 RVA: 0x000617B0 File Offset: 0x0005F9B0
protected override bool IsByRefImpl()
{
return true;
}
// Token: 0x17000479 RID: 1145
// (get) Token: 0x0600196E RID: 6510 RVA: 0x000617B4 File Offset: 0x0005F9B4
public override Type BaseType
{
get
{
return typeof(Array);
}
}
// Token: 0x0600196F RID: 6511 RVA: 0x000617C0 File Offset: 0x0005F9C0
internal override string FormatName(string elementName)
{
if (elementName == null)
{
return null;
}
return elementName + "&";
}
// Token: 0x06001970 RID: 6512 RVA: 0x000617D8 File Offset: 0x0005F9D8
public override Type MakeArrayType()
{
throw new ArgumentException("Cannot create an array type of a byref type");
}
// Token: 0x06001971 RID: 6513 RVA: 0x000617E4 File Offset: 0x0005F9E4
public override Type MakeArrayType(int rank)
{
throw new ArgumentException("Cannot create an array type of a byref type");
}
// Token: 0x06001972 RID: 6514 RVA: 0x000617F0 File Offset: 0x0005F9F0
public override Type MakeByRefType()
{
throw new ArgumentException("Cannot create a byref type of an already byref type");
}
// Token: 0x06001973 RID: 6515 RVA: 0x000617FC File Offset: 0x0005F9FC
public override Type MakePointerType()
{
throw new ArgumentException("Cannot create a pointer type of a byref type");
}
}
}
@@ -0,0 +1,628 @@
using System;
using System.Diagnostics.SymbolStore;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
namespace System.Reflection.Emit
{
/// <summary>Defines and represents a constructor of a dynamic class.</summary>
// Token: 0x020001E2 RID: 482
[ComVisible(true)]
[ComDefaultInterface(typeof(_ConstructorBuilder))]
[ClassInterface(ClassInterfaceType.None)]
public sealed class ConstructorBuilder : ConstructorInfo, _ConstructorBuilder
{
// Token: 0x060018DC RID: 6364 RVA: 0x0005FD78 File Offset: 0x0005DF78
internal ConstructorBuilder(TypeBuilder tb, MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt)
{
this.attrs = attributes | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName;
this.call_conv = callingConvention;
if (parameterTypes != null)
{
for (int i = 0; i < parameterTypes.Length; i++)
{
if (parameterTypes[i] == null)
{
throw new ArgumentException("Elements of the parameterTypes array cannot be null", "parameterTypes");
}
}
this.parameters = new Type[parameterTypes.Length];
Array.Copy(parameterTypes, this.parameters, parameterTypes.Length);
}
this.type = tb;
this.paramModReq = paramModReq;
this.paramModOpt = paramModOpt;
this.table_idx = this.get_next_table_index(this, 6, true);
((ModuleBuilder)tb.Module).RegisterToken(this, this.GetToken().Token);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x060018DD RID: 6365 RVA: 0x0005FE48 File Offset: 0x0005E048
void _ConstructorBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x060018DE RID: 6366 RVA: 0x0005FE50 File Offset: 0x0005E050
void _ConstructorBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x060018DF RID: 6367 RVA: 0x0005FE58 File Offset: 0x0005E058
void _ConstructorBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x060018E0 RID: 6368 RVA: 0x0005FE60 File Offset: 0x0005E060
void _ConstructorBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Gets a <see cref="T:System.Reflection.CallingConventions" /> value that depends on whether the declaring type is generic.</summary>
/// <returns>
/// <see cref="F:System.Reflection.CallingConventions.HasThis" /> if the declaring type is generic; otherwise, <see cref="F:System.Reflection.CallingConventions.Standard" />. </returns>
// Token: 0x17000454 RID: 1108
// (get) Token: 0x060018E1 RID: 6369 RVA: 0x0005FE68 File Offset: 0x0005E068
[MonoTODO]
public override CallingConventions CallingConvention
{
get
{
return this.call_conv;
}
}
/// <summary>Gets or sets whether the local variables in this constructor should be zero-initialized.</summary>
/// <returns>Read/write. Gets or sets whether the local variables in this constructor should be zero-initialized.</returns>
// Token: 0x17000455 RID: 1109
// (get) Token: 0x060018E2 RID: 6370 RVA: 0x0005FE70 File Offset: 0x0005E070
// (set) Token: 0x060018E3 RID: 6371 RVA: 0x0005FE78 File Offset: 0x0005E078
public bool InitLocals
{
get
{
return this.init_locals;
}
set
{
this.init_locals = value;
}
}
// Token: 0x17000456 RID: 1110
// (get) Token: 0x060018E4 RID: 6372 RVA: 0x0005FE84 File Offset: 0x0005E084
internal TypeBuilder TypeBuilder
{
get
{
return this.type;
}
}
/// <summary>Returns the method implementation flags for this constructor.</summary>
/// <returns>The method implementation flags for this constructor.</returns>
// Token: 0x060018E5 RID: 6373 RVA: 0x0005FE8C File Offset: 0x0005E08C
public override MethodImplAttributes GetMethodImplementationFlags()
{
return this.iattrs;
}
/// <summary>Returns the parameters of this constructor.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.ParameterInfo" /> objects that represent the parameters of this constructor.</returns>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has not been called on this constructor's type, in the .NET Framework versions 1.0 and 1.1. </exception>
/// <exception cref="T:System.NotSupportedException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has not been called on this constructor's type, in the .NET Framework version 2.0. </exception>
// Token: 0x060018E6 RID: 6374 RVA: 0x0005FE94 File Offset: 0x0005E094
public override ParameterInfo[] GetParameters()
{
if (!this.type.is_created && !this.IsCompilerContext)
{
throw this.not_created();
}
return this.GetParametersInternal();
}
// Token: 0x060018E7 RID: 6375 RVA: 0x0005FECC File Offset: 0x0005E0CC
internal ParameterInfo[] GetParametersInternal()
{
if (this.parameters == null)
{
return new ParameterInfo[0];
}
ParameterInfo[] array = new ParameterInfo[this.parameters.Length];
for (int i = 0; i < this.parameters.Length; i++)
{
array[i] = new ParameterInfo((this.pinfo != null) ? this.pinfo[i + 1] : null, this.parameters[i], this, i + 1);
}
return array;
}
// Token: 0x060018E8 RID: 6376 RVA: 0x0005FF44 File Offset: 0x0005E144
internal override int GetParameterCount()
{
if (this.parameters == null)
{
return 0;
}
return this.parameters.Length;
}
/// <summary>Dynamically invokes the constructor reflected by this instance with the specified arguments, under the constraints of the specified Binder.</summary>
/// <returns>An instance of the class associated with the constructor.</returns>
/// <param name="obj">The object that needs to be reinitialized. </param>
/// <param name="invokeAttr">One of the BindingFlags values that specifies the type of binding that is desired. </param>
/// <param name="binder">A Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If <paramref name="binder" /> is null, then Binder.DefaultBinding is used. </param>
/// <param name="parameters">An argument list. This is an array of arguments with the same number, order, and type as the parameters of the constructor to be invoked. If there are no parameters, this should be a null reference (Nothing in Visual Basic). </param>
/// <param name="culture">A <see cref="T:System.Globalization.CultureInfo" /> used to govern the coercion of types. If this is null, the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. You can retrieve the constructor using <see cref="M:System.Type.GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Reflection.ConstructorInfo.Invoke(System.Reflection.BindingFlags,System.Reflection.Binder,System.Object[],System.Globalization.CultureInfo)" /> on the returned <see cref="T:System.Reflection.ConstructorInfo" />. </exception>
// Token: 0x060018E9 RID: 6377 RVA: 0x0005FF5C File Offset: 0x0005E15C
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
throw this.not_supported();
}
/// <summary>Invokes the constructor dynamically reflected by this instance on the given object, passing along the specified parameters, and under the constraints of the given binder.</summary>
/// <returns>Returns an <see cref="T:System.Object" /> that is the return value of the invoked constructor.</returns>
/// <param name="invokeAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, such as InvokeMethod, NonPublic, and so on. </param>
/// <param name="binder">An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is null, the default binder is used. See <see cref="T:System.Reflection.Binder" />. </param>
/// <param name="parameters">An argument list. This is an array of arguments with the same number, order, and type as the parameters of the constructor to be invoked. If there are no parameters this should be null. </param>
/// <param name="culture">An instance of <see cref="T:System.Globalization.CultureInfo" /> used to govern the coercion of types. If this is null, the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used. (For example, this is necessary to convert a <see cref="T:System.String" /> that represents 1000 to a <see cref="T:System.Double" /> value, since 1000 is represented differently by different cultures.) </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. You can retrieve the constructor using <see cref="M:System.Type.GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Reflection.ConstructorInfo.Invoke(System.Reflection.BindingFlags,System.Reflection.Binder,System.Object[],System.Globalization.CultureInfo)" /> on the returned <see cref="T:System.Reflection.ConstructorInfo" />. </exception>
// Token: 0x060018EA RID: 6378 RVA: 0x0005FF64 File Offset: 0x0005E164
public override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
throw this.not_supported();
}
/// <summary>Retrieves the internal handle for the method. Use this handle to access the underlying metadata handle.</summary>
/// <returns>Returns the internal handle for the method. Use this handle to access the underlying metadata handle.</returns>
/// <exception cref="T:System.NotSupportedException">This property is not supported on this class. </exception>
// Token: 0x17000457 RID: 1111
// (get) Token: 0x060018EB RID: 6379 RVA: 0x0005FF6C File Offset: 0x0005E16C
public override RuntimeMethodHandle MethodHandle
{
get
{
throw this.not_supported();
}
}
/// <summary>Retrieves the attributes for this constructor.</summary>
/// <returns>Returns the attributes for this constructor.</returns>
// Token: 0x17000458 RID: 1112
// (get) Token: 0x060018EC RID: 6380 RVA: 0x0005FF74 File Offset: 0x0005E174
public override MethodAttributes Attributes
{
get
{
return this.attrs;
}
}
/// <summary>Holds a reference to the <see cref="T:System.Type" /> object from which this object was obtained.</summary>
/// <returns>Returns the Type object from which this object was obtained.</returns>
// Token: 0x17000459 RID: 1113
// (get) Token: 0x060018ED RID: 6381 RVA: 0x0005FF7C File Offset: 0x0005E17C
public override Type ReflectedType
{
get
{
return this.type;
}
}
/// <summary>Retrieves a reference to the <see cref="T:System.Type" /> object for the type that declares this member.</summary>
/// <returns>Returns the <see cref="T:System.Type" /> object for the type that declares this member.</returns>
// Token: 0x1700045A RID: 1114
// (get) Token: 0x060018EE RID: 6382 RVA: 0x0005FF84 File Offset: 0x0005E184
public override Type DeclaringType
{
get
{
return this.type;
}
}
/// <summary>Gets null.</summary>
/// <returns>Returns null.</returns>
// Token: 0x1700045B RID: 1115
// (get) Token: 0x060018EF RID: 6383 RVA: 0x0005FF8C File Offset: 0x0005E18C
public Type ReturnType
{
get
{
return null;
}
}
/// <summary>Retrieves the name of this constructor.</summary>
/// <returns>Returns the name of this constructor.</returns>
// Token: 0x1700045C RID: 1116
// (get) Token: 0x060018F0 RID: 6384 RVA: 0x0005FF90 File Offset: 0x0005E190
public override string Name
{
get
{
return ((this.attrs & MethodAttributes.Static) == MethodAttributes.PrivateScope) ? ConstructorInfo.ConstructorName : ConstructorInfo.TypeConstructorName;
}
}
/// <summary>Retrieves the signature of the field in the form of a string.</summary>
/// <returns>Returns the signature of the field.</returns>
// Token: 0x1700045D RID: 1117
// (get) Token: 0x060018F1 RID: 6385 RVA: 0x0005FFB0 File Offset: 0x0005E1B0
public string Signature
{
get
{
return "constructor signature";
}
}
/// <summary>Adds declarative security to this constructor.</summary>
/// <param name="action">The security action to be taken, such as Demand, Assert, and so on. </param>
/// <param name="pset">The set of permissions the action applies to. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="action" /> is invalid (RequestMinimum, RequestOptional, and RequestRefuse are invalid). </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- The permission set <paramref name="pset" /> contains an action that was added earlier by AddDeclarativeSecurity. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="pset" /> is null. </exception>
// Token: 0x060018F2 RID: 6386 RVA: 0x0005FFB8 File Offset: 0x0005E1B8
public void AddDeclarativeSecurity(SecurityAction action, PermissionSet pset)
{
}
/// <summary>Defines a parameter of this constructor.</summary>
/// <returns>Returns a ParameterBuilder object that represents the new parameter of this constructor.</returns>
/// <param name="iSequence">The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter. </param>
/// <param name="attributes">The attributes of the parameter. </param>
/// <param name="strParamName">The name of the parameter. The name can be the null string. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="position" /> is less than or equal to zero, or it is greater than the number of parameters of the constructor. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x060018F3 RID: 6387 RVA: 0x0005FFBC File Offset: 0x0005E1BC
public ParameterBuilder DefineParameter(int iSequence, ParameterAttributes attributes, string strParamName)
{
if (iSequence < 1 || iSequence > this.GetParameterCount())
{
throw new ArgumentOutOfRangeException("iSequence");
}
if (this.type.is_created)
{
throw this.not_after_created();
}
ParameterBuilder parameterBuilder = new ParameterBuilder(this, iSequence, attributes, strParamName);
if (this.pinfo == null)
{
this.pinfo = new ParameterBuilder[this.parameters.Length + 1];
}
this.pinfo[iSequence] = parameterBuilder;
return parameterBuilder;
}
/// <summary>Checks if the specified custom attribute type is defined.</summary>
/// <returns>true if the specified custom attribute type is defined; otherwise, false.</returns>
/// <param name="attributeType">A custom attribute type. </param>
/// <param name="inherit">Controls inheritance of custom attributes from base classes. This parameter is ignored. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. You can retrieve the constructor using <see cref="M:System.Type.GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean)" /> on the returned <see cref="T:System.Reflection.ConstructorInfo" />. </exception>
// Token: 0x060018F4 RID: 6388 RVA: 0x00060034 File Offset: 0x0005E234
public override bool IsDefined(Type attributeType, bool inherit)
{
throw this.not_supported();
}
/// <summary>Returns all the custom attributes defined for this constructor.</summary>
/// <returns>Returns an array of objects representing all the custom attributes of the constructor represented by this <see cref="T:System.Reflection.Emit.ConstructorBuilder" /> instance.</returns>
/// <param name="inherit">Controls inheritance of custom attributes from base classes. This parameter is ignored. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
// Token: 0x060018F5 RID: 6389 RVA: 0x0006003C File Offset: 0x0005E23C
public override object[] GetCustomAttributes(bool inherit)
{
if (this.type.is_created && this.IsCompilerContext)
{
return MonoCustomAttrs.GetCustomAttributes(this, inherit);
}
throw this.not_supported();
}
/// <summary>Returns the custom attributes identified by the given type.</summary>
/// <returns>Returns an array of type <see cref="T:System.Object" /> representing the attributes of this constructor.</returns>
/// <param name="attributeType">The custom attribute type. </param>
/// <param name="inherit">Controls inheritance of custom attributes from base classes. This parameter is ignored. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
// Token: 0x060018F6 RID: 6390 RVA: 0x00060074 File Offset: 0x0005E274
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
if (this.type.is_created && this.IsCompilerContext)
{
return MonoCustomAttrs.GetCustomAttributes(this, attributeType, inherit);
}
throw this.not_supported();
}
/// <summary>Gets an <see cref="T:System.Reflection.Emit.ILGenerator" /> for this constructor.</summary>
/// <returns>Returns an <see cref="T:System.Reflection.Emit.ILGenerator" /> object for this constructor.</returns>
/// <exception cref="T:System.InvalidOperationException">The constructor is a default constructor.-or-The constructor has <see cref="T:System.Reflection.MethodAttributes" /> or <see cref="T:System.Reflection.MethodImplAttributes" /> flags indicating that it should not have a method body.</exception>
// Token: 0x060018F7 RID: 6391 RVA: 0x000600AC File Offset: 0x0005E2AC
public ILGenerator GetILGenerator()
{
return this.GetILGenerator(64);
}
/// <summary>Gets an <see cref="T:System.Reflection.Emit.ILGenerator" /> object, with the specified MSIL stream size, that can be used to build a method body for this constructor.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.ILGenerator" /> for this constructor.</returns>
/// <param name="streamSize">The size of the MSIL stream, in bytes.</param>
/// <exception cref="T:System.InvalidOperationException">The constructor is a default constructor.-or-The constructor has <see cref="T:System.Reflection.MethodAttributes" /> or <see cref="T:System.Reflection.MethodImplAttributes" /> flags indicating that it should not have a method body. </exception>
// Token: 0x060018F8 RID: 6392 RVA: 0x000600B8 File Offset: 0x0005E2B8
public ILGenerator GetILGenerator(int streamSize)
{
if (this.ilgen != null)
{
return this.ilgen;
}
this.ilgen = new ILGenerator(this.type.Module, ((ModuleBuilder)this.type.Module).GetTokenGenerator(), streamSize);
return this.ilgen;
}
/// <summary>Set a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="customBuilder" /> is null. </exception>
// Token: 0x060018F9 RID: 6393 RVA: 0x0006010C File Offset: 0x0005E30C
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Runtime.CompilerServices.MethodImplAttribute")
{
byte[] data = customBuilder.Data;
int num = (int)data[2];
num |= (int)data[3] << 8;
this.SetImplementationFlags((MethodImplAttributes)num);
return;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Set a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
// Token: 0x060018FA RID: 6394 RVA: 0x000601BC File Offset: 0x0005E3BC
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
if (con == null)
{
throw new ArgumentNullException("con");
}
if (binaryAttribute == null)
{
throw new ArgumentNullException("binaryAttribute");
}
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Sets the method implementation flags for this constructor.</summary>
/// <param name="attributes">The method implementation flags. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x060018FB RID: 6395 RVA: 0x000601F0 File Offset: 0x0005E3F0
public void SetImplementationFlags(MethodImplAttributes attributes)
{
if (this.type.is_created)
{
throw this.not_after_created();
}
this.iattrs = attributes;
}
/// <summary>Returns a reference to the module that contains this constructor.</summary>
/// <returns>The module that contains this constructor.</returns>
// Token: 0x060018FC RID: 6396 RVA: 0x00060210 File Offset: 0x0005E410
public Module GetModule()
{
return this.type.Module;
}
/// <summary>Returns the <see cref="T:System.Reflection.Emit.MethodToken" /> that represents the token for this constructor.</summary>
/// <returns>Returns the <see cref="T:System.Reflection.Emit.MethodToken" /> of this constructor.</returns>
// Token: 0x060018FD RID: 6397 RVA: 0x00060220 File Offset: 0x0005E420
public MethodToken GetToken()
{
return new MethodToken(100663296 | this.table_idx);
}
/// <summary>Sets this constructor's custom attribute associated with symbolic information.</summary>
/// <param name="name">The name of the custom attribute. </param>
/// <param name="data">The value of the custom attribute. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- The module does not have a symbol writer defined. For example, the module is not a debug module. </exception>
// Token: 0x060018FE RID: 6398 RVA: 0x00060234 File Offset: 0x0005E434
[MonoTODO]
public void SetSymCustomAttribute(string name, byte[] data)
{
if (this.type.is_created)
{
throw this.not_after_created();
}
}
/// <summary>Gets the dynamic module in which this constructor is defined.</summary>
/// <returns>A <see cref="T:System.Reflection.Module" /> object that represents the dynamic module in which this constructor is defined.</returns>
// Token: 0x1700045E RID: 1118
// (get) Token: 0x060018FF RID: 6399 RVA: 0x00060250 File Offset: 0x0005E450
public override Module Module
{
get
{
return base.Module;
}
}
/// <summary>Returns this <see cref="T:System.Reflection.Emit.ConstructorBuilder" /> instance as a <see cref="T:System.String" />.</summary>
/// <returns>Returns a <see cref="T:System.String" /> containing the name, attributes, and exceptions of this constructor, followed by the current Microsoft intermediate language (MSIL) stream.</returns>
// Token: 0x06001900 RID: 6400 RVA: 0x00060258 File Offset: 0x0005E458
public override string ToString()
{
return "ConstructorBuilder ['" + this.type.Name + "']";
}
// Token: 0x06001901 RID: 6401 RVA: 0x00060274 File Offset: 0x0005E474
internal void fixup()
{
if ((this.attrs & (MethodAttributes.Abstract | MethodAttributes.PinvokeImpl)) == MethodAttributes.PrivateScope && (this.iattrs & (MethodImplAttributes)4099) == MethodImplAttributes.IL && (this.ilgen == null || ILGenerator.Mono_GetCurrentOffset(this.ilgen) == 0))
{
throw new InvalidOperationException("Method '" + this.Name + "' does not have a method body.");
}
if (this.ilgen != null)
{
this.ilgen.label_fixup();
}
}
// Token: 0x06001902 RID: 6402 RVA: 0x000602F0 File Offset: 0x0005E4F0
internal void GenerateDebugInfo(ISymbolWriter symbolWriter)
{
if (this.ilgen != null && this.ilgen.HasDebugInfo)
{
SymbolToken symbolToken = new SymbolToken(this.GetToken().Token);
symbolWriter.OpenMethod(symbolToken);
symbolWriter.SetSymAttribute(symbolToken, "__name", Encoding.UTF8.GetBytes(this.Name));
this.ilgen.GenerateDebugInfo(symbolWriter);
symbolWriter.CloseMethod();
}
}
// Token: 0x06001903 RID: 6403 RVA: 0x00060364 File Offset: 0x0005E564
internal override int get_next_table_index(object obj, int table, bool inc)
{
return this.type.get_next_table_index(obj, table, inc);
}
// Token: 0x1700045F RID: 1119
// (get) Token: 0x06001904 RID: 6404 RVA: 0x00060374 File Offset: 0x0005E574
private bool IsCompilerContext
{
get
{
ModuleBuilder moduleBuilder = (ModuleBuilder)this.TypeBuilder.Module;
AssemblyBuilder assemblyBuilder = (AssemblyBuilder)moduleBuilder.Assembly;
return assemblyBuilder.IsCompilerContext;
}
}
// Token: 0x06001905 RID: 6405 RVA: 0x000603A4 File Offset: 0x0005E5A4
private void RejectIfCreated()
{
if (this.type.is_created)
{
throw new InvalidOperationException("Type definition of the method is complete.");
}
}
// Token: 0x06001906 RID: 6406 RVA: 0x000603C4 File Offset: 0x0005E5C4
private Exception not_supported()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
// Token: 0x06001907 RID: 6407 RVA: 0x000603D0 File Offset: 0x0005E5D0
private Exception not_after_created()
{
return new InvalidOperationException("Unable to change after type has been created.");
}
// Token: 0x06001908 RID: 6408 RVA: 0x000603DC File Offset: 0x0005E5DC
private Exception not_created()
{
return new NotSupportedException("The type is not yet created.");
}
// Token: 0x04000771 RID: 1905
private RuntimeMethodHandle mhandle;
// Token: 0x04000772 RID: 1906
private ILGenerator ilgen;
// Token: 0x04000773 RID: 1907
internal Type[] parameters;
// Token: 0x04000774 RID: 1908
private MethodAttributes attrs;
// Token: 0x04000775 RID: 1909
private MethodImplAttributes iattrs;
// Token: 0x04000776 RID: 1910
private int table_idx;
// Token: 0x04000777 RID: 1911
private CallingConventions call_conv;
// Token: 0x04000778 RID: 1912
private TypeBuilder type;
// Token: 0x04000779 RID: 1913
internal ParameterBuilder[] pinfo;
// Token: 0x0400077A RID: 1914
private CustomAttributeBuilder[] cattrs;
// Token: 0x0400077B RID: 1915
private bool init_locals = true;
// Token: 0x0400077C RID: 1916
private Type[][] paramModReq;
// Token: 0x0400077D RID: 1917
private Type[][] paramModOpt;
// Token: 0x0400077E RID: 1918
private RefEmitPermissionSet[] permissions;
}
}
@@ -0,0 +1,190 @@
using System;
using System.Globalization;
namespace System.Reflection.Emit
{
// Token: 0x020001E3 RID: 483
internal class ConstructorOnTypeBuilderInst : ConstructorInfo
{
// Token: 0x06001909 RID: 6409 RVA: 0x000603E8 File Offset: 0x0005E5E8
public ConstructorOnTypeBuilderInst(MonoGenericClass instantiation, ConstructorBuilder cb)
{
this.instantiation = instantiation;
this.cb = cb;
}
// Token: 0x17000460 RID: 1120
// (get) Token: 0x0600190A RID: 6410 RVA: 0x00060400 File Offset: 0x0005E600
public override Type DeclaringType
{
get
{
return this.instantiation;
}
}
// Token: 0x17000461 RID: 1121
// (get) Token: 0x0600190B RID: 6411 RVA: 0x00060408 File Offset: 0x0005E608
public override string Name
{
get
{
return this.cb.Name;
}
}
// Token: 0x17000462 RID: 1122
// (get) Token: 0x0600190C RID: 6412 RVA: 0x00060418 File Offset: 0x0005E618
public override Type ReflectedType
{
get
{
return this.instantiation;
}
}
// Token: 0x0600190D RID: 6413 RVA: 0x00060420 File Offset: 0x0005E620
public override bool IsDefined(Type attributeType, bool inherit)
{
return this.cb.IsDefined(attributeType, inherit);
}
// Token: 0x0600190E RID: 6414 RVA: 0x00060430 File Offset: 0x0005E630
public override object[] GetCustomAttributes(bool inherit)
{
return this.cb.GetCustomAttributes(inherit);
}
// Token: 0x0600190F RID: 6415 RVA: 0x00060440 File Offset: 0x0005E640
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return this.cb.GetCustomAttributes(attributeType, inherit);
}
// Token: 0x06001910 RID: 6416 RVA: 0x00060450 File Offset: 0x0005E650
public override MethodImplAttributes GetMethodImplementationFlags()
{
return this.cb.GetMethodImplementationFlags();
}
// Token: 0x06001911 RID: 6417 RVA: 0x00060460 File Offset: 0x0005E660
public override ParameterInfo[] GetParameters()
{
if (!((ModuleBuilder)this.cb.Module).assemblyb.IsCompilerContext && !this.instantiation.generic_type.is_created)
{
throw new NotSupportedException();
}
ParameterInfo[] array = new ParameterInfo[this.cb.parameters.Length];
for (int i = 0; i < this.cb.parameters.Length; i++)
{
Type type = this.instantiation.InflateType(this.cb.parameters[i]);
array[i] = new ParameterInfo((this.cb.pinfo != null) ? this.cb.pinfo[i] : null, type, this, i + 1);
}
return array;
}
// Token: 0x17000463 RID: 1123
// (get) Token: 0x06001912 RID: 6418 RVA: 0x00060524 File Offset: 0x0005E724
public override int MetadataToken
{
get
{
if (!((ModuleBuilder)this.cb.Module).assemblyb.IsCompilerContext)
{
return base.MetadataToken;
}
return this.cb.MetadataToken;
}
}
// Token: 0x06001913 RID: 6419 RVA: 0x00060564 File Offset: 0x0005E764
internal override int GetParameterCount()
{
return this.cb.GetParameterCount();
}
// Token: 0x06001914 RID: 6420 RVA: 0x00060574 File Offset: 0x0005E774
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
return this.cb.Invoke(obj, invokeAttr, binder, parameters, culture);
}
// Token: 0x17000464 RID: 1124
// (get) Token: 0x06001915 RID: 6421 RVA: 0x00060588 File Offset: 0x0005E788
public override RuntimeMethodHandle MethodHandle
{
get
{
return this.cb.MethodHandle;
}
}
// Token: 0x17000465 RID: 1125
// (get) Token: 0x06001916 RID: 6422 RVA: 0x00060598 File Offset: 0x0005E798
public override MethodAttributes Attributes
{
get
{
return this.cb.Attributes;
}
}
// Token: 0x17000466 RID: 1126
// (get) Token: 0x06001917 RID: 6423 RVA: 0x000605A8 File Offset: 0x0005E7A8
public override CallingConventions CallingConvention
{
get
{
return this.cb.CallingConvention;
}
}
// Token: 0x06001918 RID: 6424 RVA: 0x000605B8 File Offset: 0x0005E7B8
public override Type[] GetGenericArguments()
{
return this.cb.GetGenericArguments();
}
// Token: 0x17000467 RID: 1127
// (get) Token: 0x06001919 RID: 6425 RVA: 0x000605C8 File Offset: 0x0005E7C8
public override bool ContainsGenericParameters
{
get
{
return false;
}
}
// Token: 0x17000468 RID: 1128
// (get) Token: 0x0600191A RID: 6426 RVA: 0x000605CC File Offset: 0x0005E7CC
public override bool IsGenericMethodDefinition
{
get
{
return false;
}
}
// Token: 0x17000469 RID: 1129
// (get) Token: 0x0600191B RID: 6427 RVA: 0x000605D0 File Offset: 0x0005E7D0
public override bool IsGenericMethod
{
get
{
return false;
}
}
// Token: 0x0600191C RID: 6428 RVA: 0x000605D4 File Offset: 0x0005E7D4
public override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
throw new InvalidOperationException();
}
// Token: 0x0400077F RID: 1919
private MonoGenericClass instantiation;
// Token: 0x04000780 RID: 1920
private ConstructorBuilder cb;
}
}
@@ -0,0 +1,658 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
namespace System.Reflection.Emit
{
/// <summary>Helps build custom attributes.</summary>
// Token: 0x020001E4 RID: 484
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_CustomAttributeBuilder))]
[ComVisible(true)]
public class CustomAttributeBuilder : _CustomAttributeBuilder
{
// Token: 0x0600191D RID: 6429 RVA: 0x000605DC File Offset: 0x0005E7DC
internal CustomAttributeBuilder(ConstructorInfo con, byte[] cdata)
{
this.ctor = con;
this.data = (byte[])cdata.Clone();
}
/// <summary>Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute and the arguments to the constructor.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="constructorArgs">The arguments to the constructor of the custom attribute. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="con" /> is static or private.-or- The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.-or- The type of supplied argument does not match the type of the parameter declared in the constructor. -or-A supplied argument is a reference type other than <see cref="T:System.String" /> or <see cref="T:System.Type" />.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="constructorArgs" /> is null. </exception>
// Token: 0x0600191E RID: 6430 RVA: 0x000605FC File Offset: 0x0005E7FC
public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs)
{
this.Initialize(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]);
}
/// <summary>Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, and a set of named field/value pairs.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="constructorArgs">The arguments to the constructor of the custom attribute. </param>
/// <param name="namedFields">Named fields of the custom attribute. </param>
/// <param name="fieldValues">Values for the named fields of the custom attribute. </param>
/// <exception cref="T:System.ArgumentException">The lengths of the <paramref name="namedFields" /> and <paramref name="fieldValues" /> arrays are different.-or- <paramref name="con" /> is static or private.-or- The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.-or- The type of supplied argument does not match the type of the parameter declared in the constructor.-or- The types of the field values do not match the types of the named fields.-or- The field does not belong to the same class or base class as the constructor. -or-A supplied argument or named field is a reference type other than <see cref="T:System.String" /> or <see cref="T:System.Type" />.</exception>
/// <exception cref="T:System.ArgumentNullException">One of the parameters is null. </exception>
// Token: 0x0600191F RID: 6431 RVA: 0x00060630 File Offset: 0x0005E830
public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs, FieldInfo[] namedFields, object[] fieldValues)
{
this.Initialize(con, constructorArgs, new PropertyInfo[0], new object[0], namedFields, fieldValues);
}
/// <summary>Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, and a set of named property or value pairs.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="constructorArgs">The arguments to the constructor of the custom attribute. </param>
/// <param name="namedProperties">Named properties of the custom attribute. </param>
/// <param name="propertyValues">Values for the named properties of the custom attribute. </param>
/// <exception cref="T:System.ArgumentException">The lengths of the <paramref name="namedProperties" /> and <paramref name="propertyValues" /> arrays are different.-or- <paramref name="con" /> is static or private.-or- The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.-or- The type of supplied argument does not match the type of the parameter declared in the constructor.-or- The types of the property values do not match the types of the named properties.-or- A property has no setter method.-or- The property does not belong to the same class or base class as the constructor. -or-A supplied argument or named property is a reference type other than <see cref="T:System.String" /> or <see cref="T:System.Type" />.</exception>
/// <exception cref="T:System.ArgumentNullException">One of the parameters is null. </exception>
// Token: 0x06001920 RID: 6432 RVA: 0x0006065C File Offset: 0x0005E85C
public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues)
{
this.Initialize(con, constructorArgs, namedProperties, propertyValues, new FieldInfo[0], new object[0]);
}
/// <summary>Initializes an instance of the CustomAttributeBuilder class given the constructor for the custom attribute, the arguments to the constructor, a set of named property or value pairs, and a set of named field or value pairs.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="constructorArgs">The arguments to the constructor of the custom attribute. </param>
/// <param name="namedProperties">Named properties of the custom attribute. </param>
/// <param name="propertyValues">Values for the named properties of the custom attribute. </param>
/// <param name="namedFields">Named fields of the custom attribute. </param>
/// <param name="fieldValues">Values for the named fields of the custom attribute. </param>
/// <exception cref="T:System.ArgumentException">The lengths of the <paramref name="namedProperties" /> and <paramref name="propertyValues" /> arrays are different.-or- The lengths of the <paramref name="namedFields" /> and <paramref name="fieldValues" /> arrays are different.-or- <paramref name="con" /> is static or private.-or- The number of supplied arguments does not match the number of parameters of the constructor as required by the calling convention of the constructor.-or- The type of supplied argument does not match the type of the parameter declared in the constructor.-or- The types of the property values do not match the types of the named properties.-or- The types of the field values do not match the types of the corresponding field types.-or- A property has no setter.-or- The property or field does not belong to the same class or base class as the constructor. -or-A supplied argument, named property, or named field is a reference type other than <see cref="T:System.String" /> or <see cref="T:System.Type" />.</exception>
/// <exception cref="T:System.ArgumentNullException">One of the parameters is null. </exception>
// Token: 0x06001921 RID: 6433 RVA: 0x00060688 File Offset: 0x0005E888
public CustomAttributeBuilder(ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues)
{
this.Initialize(con, constructorArgs, namedProperties, propertyValues, namedFields, fieldValues);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001922 RID: 6434 RVA: 0x000606AC File Offset: 0x0005E8AC
void _CustomAttributeBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001923 RID: 6435 RVA: 0x000606B4 File Offset: 0x0005E8B4
void _CustomAttributeBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001924 RID: 6436 RVA: 0x000606BC File Offset: 0x0005E8BC
void _CustomAttributeBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001925 RID: 6437 RVA: 0x000606C4 File Offset: 0x0005E8C4
void _CustomAttributeBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x1700046A RID: 1130
// (get) Token: 0x06001926 RID: 6438 RVA: 0x000606CC File Offset: 0x0005E8CC
internal ConstructorInfo Ctor
{
get
{
return this.ctor;
}
}
// Token: 0x1700046B RID: 1131
// (get) Token: 0x06001927 RID: 6439 RVA: 0x000606D4 File Offset: 0x0005E8D4
internal byte[] Data
{
get
{
return this.data;
}
}
// Token: 0x06001928 RID: 6440
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern byte[] GetBlob(Assembly asmb, ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues);
// Token: 0x06001929 RID: 6441 RVA: 0x000606DC File Offset: 0x0005E8DC
private bool IsValidType(Type t)
{
if (t.IsArray && t.GetArrayRank() > 1)
{
return false;
}
if (t is TypeBuilder && t.IsEnum)
{
Enum.GetUnderlyingType(t);
}
return true;
}
// Token: 0x0600192A RID: 6442 RVA: 0x00060720 File Offset: 0x0005E920
private void Initialize(ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues)
{
this.ctor = con;
if (con == null)
{
throw new ArgumentNullException("con");
}
if (constructorArgs == null)
{
throw new ArgumentNullException("constructorArgs");
}
if (namedProperties == null)
{
throw new ArgumentNullException("namedProperties");
}
if (propertyValues == null)
{
throw new ArgumentNullException("propertyValues");
}
if (namedFields == null)
{
throw new ArgumentNullException("namedFields");
}
if (fieldValues == null)
{
throw new ArgumentNullException("fieldValues");
}
if (con.GetParameterCount() != constructorArgs.Length)
{
throw new ArgumentException("Parameter count does not match passed in argument value count.");
}
if (namedProperties.Length != propertyValues.Length)
{
throw new ArgumentException("Array lengths must be the same.", "namedProperties, propertyValues");
}
if (namedFields.Length != fieldValues.Length)
{
throw new ArgumentException("Array lengths must be the same.", "namedFields, fieldValues");
}
if ((con.Attributes & MethodAttributes.Static) == MethodAttributes.Static || (con.Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Private)
{
throw new ArgumentException("Cannot have private or static constructor.");
}
Type declaringType = this.ctor.DeclaringType;
int num = 0;
foreach (FieldInfo fieldInfo in namedFields)
{
Type declaringType2 = fieldInfo.DeclaringType;
if (!this.IsValidType(declaringType2))
{
throw new ArgumentException("Field '" + fieldInfo.Name + "' does not have a valid type.");
}
if (declaringType != declaringType2 && !declaringType2.IsSubclassOf(declaringType) && !declaringType.IsSubclassOf(declaringType2))
{
throw new ArgumentException("Field '" + fieldInfo.Name + "' does not belong to the same class as the constructor");
}
if (fieldValues[num] != null && !(fieldInfo.FieldType is TypeBuilder) && !fieldInfo.FieldType.IsEnum && !fieldInfo.FieldType.IsInstanceOfType(fieldValues[num]) && !fieldInfo.FieldType.IsArray)
{
throw new ArgumentException(string.Concat(new object[] { "Value of field '", fieldInfo.Name, "' does not match field type: ", fieldInfo.FieldType }));
}
num++;
}
num = 0;
foreach (PropertyInfo propertyInfo in namedProperties)
{
if (!propertyInfo.CanWrite)
{
throw new ArgumentException("Property '" + propertyInfo.Name + "' does not have a setter.");
}
Type declaringType3 = propertyInfo.DeclaringType;
if (!this.IsValidType(declaringType3))
{
throw new ArgumentException("Property '" + propertyInfo.Name + "' does not have a valid type.");
}
if (declaringType != declaringType3 && !declaringType3.IsSubclassOf(declaringType) && !declaringType.IsSubclassOf(declaringType3))
{
throw new ArgumentException("Property '" + propertyInfo.Name + "' does not belong to the same class as the constructor");
}
if (propertyValues[num] != null && !(propertyInfo.PropertyType is TypeBuilder) && !propertyInfo.PropertyType.IsEnum && !propertyInfo.PropertyType.IsInstanceOfType(propertyValues[num]) && !propertyInfo.PropertyType.IsArray)
{
throw new ArgumentException(string.Concat(new object[]
{
"Value of property '",
propertyInfo.Name,
"' does not match property type: ",
propertyInfo.PropertyType,
" -> ",
propertyValues[num]
}));
}
num++;
}
num = 0;
foreach (ParameterInfo parameterInfo in CustomAttributeBuilder.GetParameters(con))
{
if (parameterInfo != null)
{
Type parameterType = parameterInfo.ParameterType;
if (!this.IsValidType(parameterType))
{
throw new ArgumentException("Argument " + num + " does not have a valid type.");
}
if (constructorArgs[num] != null && !(parameterType is TypeBuilder) && !parameterType.IsEnum && !parameterType.IsInstanceOfType(constructorArgs[num]) && !parameterType.IsArray)
{
throw new ArgumentException(string.Concat(new object[]
{
"Value of argument ",
num,
" does not match parameter type: ",
parameterType,
" -> ",
constructorArgs[num]
}));
}
}
num++;
}
this.data = CustomAttributeBuilder.GetBlob(declaringType.Assembly, con, constructorArgs, namedProperties, propertyValues, namedFields, fieldValues);
}
// Token: 0x0600192B RID: 6443 RVA: 0x00060B88 File Offset: 0x0005ED88
internal static int decode_len(byte[] data, int pos, out int rpos)
{
int num;
if ((data[pos] & 128) == 0)
{
num = (int)(data[pos++] & 127);
}
else if ((data[pos] & 64) == 0)
{
num = ((int)(data[pos] & 63) << 8) + (int)data[pos + 1];
pos += 2;
}
else
{
num = ((int)(data[pos] & 31) << 24) + ((int)data[pos + 1] << 16) + ((int)data[pos + 2] << 8) + (int)data[pos + 3];
pos += 4;
}
rpos = pos;
return num;
}
// Token: 0x0600192C RID: 6444 RVA: 0x00060C04 File Offset: 0x0005EE04
internal static string string_from_bytes(byte[] data, int pos, int len)
{
return Encoding.UTF8.GetString(data, pos, len);
}
// Token: 0x0600192D RID: 6445 RVA: 0x00060C14 File Offset: 0x0005EE14
internal string string_arg()
{
int num = 2;
int num2 = CustomAttributeBuilder.decode_len(this.data, num, out num);
return CustomAttributeBuilder.string_from_bytes(this.data, num, num2);
}
// Token: 0x0600192E RID: 6446 RVA: 0x00060C40 File Offset: 0x0005EE40
internal static UnmanagedMarshal get_umarshal(CustomAttributeBuilder customBuilder, bool is_field)
{
byte[] array = customBuilder.Data;
UnmanagedType unmanagedType = (UnmanagedType)80;
int num = -1;
int num2 = -1;
bool flag = false;
string text = null;
Type type = null;
string text2 = string.Empty;
int num3 = (int)array[2];
num3 |= (int)array[3] << 8;
string fullName = CustomAttributeBuilder.GetParameters(customBuilder.Ctor)[0].ParameterType.FullName;
int num4 = 6;
if (fullName == "System.Int16")
{
num4 = 4;
}
int num5 = (int)array[num4++];
num5 |= (int)array[num4++] << 8;
int i = 0;
while (i < num5)
{
num4++;
int num6 = (int)array[num4++];
if (num6 == 85)
{
int num7 = CustomAttributeBuilder.decode_len(array, num4, out num4);
CustomAttributeBuilder.string_from_bytes(array, num4, num7);
num4 += num7;
}
int num8 = CustomAttributeBuilder.decode_len(array, num4, out num4);
string text3 = CustomAttributeBuilder.string_from_bytes(array, num4, num8);
num4 += num8;
string text4 = text3;
if (text4 != null)
{
if (CustomAttributeBuilder.<>f__switch$map1C == null)
{
CustomAttributeBuilder.<>f__switch$map1C = new Dictionary<string, int>(9)
{
{ "ArraySubType", 0 },
{ "SizeConst", 1 },
{ "SafeArraySubType", 2 },
{ "IidParameterIndex", 3 },
{ "SafeArrayUserDefinedSubType", 4 },
{ "SizeParamIndex", 5 },
{ "MarshalType", 6 },
{ "MarshalTypeRef", 7 },
{ "MarshalCookie", 8 }
};
}
int num9;
if (CustomAttributeBuilder.<>f__switch$map1C.TryGetValue(text4, out num9))
{
switch (num9)
{
case 0:
{
int num10 = (int)array[num4++];
num10 |= (int)array[num4++] << 8;
num10 |= (int)array[num4++] << 16;
num10 |= (int)array[num4++] << 24;
unmanagedType = (UnmanagedType)num10;
break;
}
case 1:
{
int num10 = (int)array[num4++];
num10 |= (int)array[num4++] << 8;
num10 |= (int)array[num4++] << 16;
num10 |= (int)array[num4++] << 24;
num = num10;
flag = true;
break;
}
case 2:
{
int num10 = (int)array[num4++];
num10 |= (int)array[num4++] << 8;
num10 |= (int)array[num4++] << 16;
num10 |= (int)array[num4++] << 24;
unmanagedType = (UnmanagedType)num10;
break;
}
case 3:
num4 += 4;
break;
case 4:
num8 = CustomAttributeBuilder.decode_len(array, num4, out num4);
CustomAttributeBuilder.string_from_bytes(array, num4, num8);
num4 += num8;
break;
case 5:
{
int num10 = (int)array[num4++];
num10 |= (int)array[num4++] << 8;
num2 = num10;
flag = true;
break;
}
case 6:
num8 = CustomAttributeBuilder.decode_len(array, num4, out num4);
text = CustomAttributeBuilder.string_from_bytes(array, num4, num8);
num4 += num8;
break;
case 7:
num8 = CustomAttributeBuilder.decode_len(array, num4, out num4);
text = CustomAttributeBuilder.string_from_bytes(array, num4, num8);
type = Type.GetType(text);
num4 += num8;
break;
case 8:
num8 = CustomAttributeBuilder.decode_len(array, num4, out num4);
text2 = CustomAttributeBuilder.string_from_bytes(array, num4, num8);
num4 += num8;
break;
default:
goto IL_34F;
}
i++;
continue;
}
}
IL_34F:
throw new Exception("Unknown MarshalAsAttribute field: " + text3);
}
UnmanagedType unmanagedType2 = (UnmanagedType)num3;
switch (unmanagedType2)
{
case UnmanagedType.LPArray:
if (flag)
{
return UnmanagedMarshal.DefineLPArrayInternal(unmanagedType, num, num2);
}
return UnmanagedMarshal.DefineLPArray(unmanagedType);
default:
if (unmanagedType2 == UnmanagedType.SafeArray)
{
return UnmanagedMarshal.DefineSafeArray(unmanagedType);
}
if (unmanagedType2 != UnmanagedType.ByValArray)
{
if (unmanagedType2 != UnmanagedType.ByValTStr)
{
return UnmanagedMarshal.DefineUnmanagedMarshal((UnmanagedType)num3);
}
return UnmanagedMarshal.DefineByValTStr(num);
}
else
{
if (!is_field)
{
throw new ArgumentException("Specified unmanaged type is only valid on fields");
}
return UnmanagedMarshal.DefineByValArray(num);
}
break;
case UnmanagedType.CustomMarshaler:
return UnmanagedMarshal.DefineCustom(type, text2, text, Guid.Empty);
}
}
// Token: 0x0600192F RID: 6447 RVA: 0x0006104C File Offset: 0x0005F24C
private static Type elementTypeToType(int elementType)
{
switch (elementType)
{
case 2:
return typeof(bool);
case 3:
return typeof(char);
case 4:
return typeof(sbyte);
case 5:
return typeof(byte);
case 6:
return typeof(short);
case 7:
return typeof(ushort);
case 8:
return typeof(int);
case 9:
return typeof(uint);
case 10:
return typeof(long);
case 11:
return typeof(ulong);
case 12:
return typeof(float);
case 13:
return typeof(double);
case 14:
return typeof(string);
default:
throw new Exception("Unknown element type '" + elementType + "'");
}
}
// Token: 0x06001930 RID: 6448 RVA: 0x00061148 File Offset: 0x0005F348
private static object decode_cattr_value(Type t, byte[] data, int pos, out int rpos)
{
TypeCode typeCode = Type.GetTypeCode(t);
switch (typeCode)
{
case TypeCode.Object:
{
int num = (int)data[pos];
pos++;
if (num >= 2 && num <= 14)
{
return CustomAttributeBuilder.decode_cattr_value(CustomAttributeBuilder.elementTypeToType(num), data, pos, out rpos);
}
throw new Exception("Subtype '" + num + "' of type object not yet handled in decode_cattr_value");
}
default:
{
if (typeCode == TypeCode.Int32)
{
rpos = pos + 4;
return (int)data[pos] + ((int)data[pos + 1] << 8) + ((int)data[pos + 2] << 16) + ((int)data[pos + 3] << 24);
}
if (typeCode != TypeCode.String)
{
throw new Exception("FIXME: Type " + t + " not yet handled in decode_cattr_value.");
}
if (data[pos] == 255)
{
rpos = pos + 1;
return null;
}
int num2 = CustomAttributeBuilder.decode_len(data, pos, out pos);
rpos = pos + num2;
return CustomAttributeBuilder.string_from_bytes(data, pos, num2);
}
case TypeCode.Boolean:
rpos = pos + 1;
return data[pos] != 0;
}
}
// Token: 0x06001931 RID: 6449 RVA: 0x0006124C File Offset: 0x0005F44C
internal static CustomAttributeBuilder.CustomAttributeInfo decode_cattr(CustomAttributeBuilder customBuilder)
{
byte[] array = customBuilder.Data;
ConstructorInfo constructorInfo = customBuilder.Ctor;
int num = 0;
CustomAttributeBuilder.CustomAttributeInfo customAttributeInfo = default(CustomAttributeBuilder.CustomAttributeInfo);
if (array.Length < 2)
{
throw new Exception("Custom attr length is only '" + array.Length + "'");
}
if (array[0] != 1 || array[1] != 0)
{
throw new Exception("Prolog invalid");
}
num = 2;
ParameterInfo[] parameters = CustomAttributeBuilder.GetParameters(constructorInfo);
customAttributeInfo.ctor = constructorInfo;
customAttributeInfo.ctorArgs = new object[parameters.Length];
for (int i = 0; i < parameters.Length; i++)
{
customAttributeInfo.ctorArgs[i] = CustomAttributeBuilder.decode_cattr_value(parameters[i].ParameterType, array, num, out num);
}
int num2 = (int)array[num] + (int)array[num + 1] * 256;
num += 2;
customAttributeInfo.namedParamNames = new string[num2];
customAttributeInfo.namedParamValues = new object[num2];
for (int j = 0; j < num2; j++)
{
int num3 = (int)array[num++];
int num4 = (int)array[num++];
string text = null;
if (num4 == 85)
{
int num5 = CustomAttributeBuilder.decode_len(array, num, out num);
text = CustomAttributeBuilder.string_from_bytes(array, num, num5);
num += num5;
}
int num6 = CustomAttributeBuilder.decode_len(array, num, out num);
string text2 = CustomAttributeBuilder.string_from_bytes(array, num, num6);
customAttributeInfo.namedParamNames[j] = text2;
num += num6;
if (num3 != 83)
{
throw new Exception("Unknown named type: " + num3);
}
FieldInfo field = constructorInfo.DeclaringType.GetField(text2, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field == null)
{
throw new Exception(string.Concat(new object[] { "Custom attribute type '", constructorInfo.DeclaringType, "' doesn't contain a field named '", text2, "'" }));
}
object obj = CustomAttributeBuilder.decode_cattr_value(field.FieldType, array, num, out num);
if (text != null)
{
Type type = Type.GetType(text);
obj = Enum.ToObject(type, obj);
}
customAttributeInfo.namedParamValues[j] = obj;
}
return customAttributeInfo;
}
// Token: 0x06001932 RID: 6450 RVA: 0x00061464 File Offset: 0x0005F664
private static ParameterInfo[] GetParameters(ConstructorInfo ctor)
{
ConstructorBuilder constructorBuilder = ctor as ConstructorBuilder;
if (constructorBuilder != null)
{
return constructorBuilder.GetParametersInternal();
}
return ctor.GetParameters();
}
// Token: 0x04000781 RID: 1921
private ConstructorInfo ctor;
// Token: 0x04000782 RID: 1922
private byte[] data;
// Token: 0x020001E5 RID: 485
internal struct CustomAttributeInfo
{
// Token: 0x04000784 RID: 1924
public ConstructorInfo ctor;
// Token: 0x04000785 RID: 1925
public object[] ctorArgs;
// Token: 0x04000786 RID: 1926
public string[] namedParamNames;
// Token: 0x04000787 RID: 1927
public object[] namedParamValues;
}
}
}
@@ -0,0 +1,373 @@
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
// Token: 0x020001E7 RID: 487
internal abstract class DerivedType : Type
{
// Token: 0x06001933 RID: 6451 RVA: 0x0006148C File Offset: 0x0005F68C
internal DerivedType(Type elementType)
{
this.elementType = elementType;
}
// Token: 0x06001934 RID: 6452
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern void create_unmanaged_type(Type type);
// Token: 0x06001935 RID: 6453
internal abstract string FormatName(string elementName);
// Token: 0x06001936 RID: 6454 RVA: 0x0006149C File Offset: 0x0005F69C
public override Type GetInterface(string name, bool ignoreCase)
{
throw new NotSupportedException();
}
// Token: 0x06001937 RID: 6455 RVA: 0x000614A4 File Offset: 0x0005F6A4
public override Type[] GetInterfaces()
{
throw new NotSupportedException();
}
// Token: 0x06001938 RID: 6456 RVA: 0x000614AC File Offset: 0x0005F6AC
public override Type GetElementType()
{
return this.elementType;
}
// Token: 0x06001939 RID: 6457 RVA: 0x000614B4 File Offset: 0x0005F6B4
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x0600193A RID: 6458 RVA: 0x000614BC File Offset: 0x0005F6BC
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x0600193B RID: 6459 RVA: 0x000614C4 File Offset: 0x0005F6C4
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x0600193C RID: 6460 RVA: 0x000614CC File Offset: 0x0005F6CC
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x0600193D RID: 6461 RVA: 0x000614D4 File Offset: 0x0005F6D4
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x0600193E RID: 6462 RVA: 0x000614DC File Offset: 0x0005F6DC
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
throw new NotSupportedException();
}
// Token: 0x0600193F RID: 6463 RVA: 0x000614E4 File Offset: 0x0005F6E4
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x06001940 RID: 6464 RVA: 0x000614EC File Offset: 0x0005F6EC
public override Type GetNestedType(string name, BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x06001941 RID: 6465 RVA: 0x000614F4 File Offset: 0x0005F6F4
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x06001942 RID: 6466 RVA: 0x000614FC File Offset: 0x0005F6FC
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x06001943 RID: 6467 RVA: 0x00061504 File Offset: 0x0005F704
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{
throw new NotSupportedException();
}
// Token: 0x06001944 RID: 6468 RVA: 0x0006150C File Offset: 0x0005F70C
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
throw new NotSupportedException();
}
// Token: 0x06001945 RID: 6469 RVA: 0x00061514 File Offset: 0x0005F714
protected override TypeAttributes GetAttributeFlagsImpl()
{
return this.elementType.Attributes;
}
// Token: 0x06001946 RID: 6470 RVA: 0x00061524 File Offset: 0x0005F724
protected override bool HasElementTypeImpl()
{
return true;
}
// Token: 0x06001947 RID: 6471 RVA: 0x00061528 File Offset: 0x0005F728
protected override bool IsArrayImpl()
{
return false;
}
// Token: 0x06001948 RID: 6472 RVA: 0x0006152C File Offset: 0x0005F72C
protected override bool IsByRefImpl()
{
return false;
}
// Token: 0x06001949 RID: 6473 RVA: 0x00061530 File Offset: 0x0005F730
protected override bool IsCOMObjectImpl()
{
return false;
}
// Token: 0x0600194A RID: 6474 RVA: 0x00061534 File Offset: 0x0005F734
protected override bool IsPointerImpl()
{
return false;
}
// Token: 0x0600194B RID: 6475 RVA: 0x00061538 File Offset: 0x0005F738
protected override bool IsPrimitiveImpl()
{
return false;
}
// Token: 0x0600194C RID: 6476 RVA: 0x0006153C File Offset: 0x0005F73C
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
throw new NotSupportedException();
}
// Token: 0x0600194D RID: 6477 RVA: 0x00061544 File Offset: 0x0005F744
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
{
throw new NotSupportedException();
}
// Token: 0x0600194E RID: 6478 RVA: 0x0006154C File Offset: 0x0005F74C
public override InterfaceMapping GetInterfaceMap(Type interfaceType)
{
throw new NotSupportedException();
}
// Token: 0x0600194F RID: 6479 RVA: 0x00061554 File Offset: 0x0005F754
public override bool IsInstanceOfType(object o)
{
return false;
}
// Token: 0x06001950 RID: 6480 RVA: 0x00061558 File Offset: 0x0005F758
public override bool IsAssignableFrom(Type c)
{
return false;
}
// Token: 0x1700046C RID: 1132
// (get) Token: 0x06001951 RID: 6481 RVA: 0x0006155C File Offset: 0x0005F75C
public override bool ContainsGenericParameters
{
get
{
return this.elementType.ContainsGenericParameters;
}
}
// Token: 0x06001952 RID: 6482 RVA: 0x0006156C File Offset: 0x0005F76C
public override Type MakeGenericType(params Type[] typeArguments)
{
throw new NotSupportedException();
}
// Token: 0x06001953 RID: 6483 RVA: 0x00061574 File Offset: 0x0005F774
public override Type MakeArrayType()
{
return new ArrayType(this, 0);
}
// Token: 0x06001954 RID: 6484 RVA: 0x00061580 File Offset: 0x0005F780
public override Type MakeArrayType(int rank)
{
if (rank < 1)
{
throw new IndexOutOfRangeException();
}
return new ArrayType(this, rank);
}
// Token: 0x06001955 RID: 6485 RVA: 0x00061598 File Offset: 0x0005F798
public override Type MakeByRefType()
{
return new ByRefType(this);
}
// Token: 0x06001956 RID: 6486 RVA: 0x000615A0 File Offset: 0x0005F7A0
public override Type MakePointerType()
{
return new PointerType(this);
}
// Token: 0x06001957 RID: 6487 RVA: 0x000615A8 File Offset: 0x0005F7A8
public override string ToString()
{
return this.FormatName(this.elementType.ToString());
}
// Token: 0x1700046D RID: 1133
// (get) Token: 0x06001958 RID: 6488 RVA: 0x000615BC File Offset: 0x0005F7BC
public override GenericParameterAttributes GenericParameterAttributes
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x1700046E RID: 1134
// (get) Token: 0x06001959 RID: 6489 RVA: 0x000615C4 File Offset: 0x0005F7C4
public override StructLayoutAttribute StructLayoutAttribute
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x1700046F RID: 1135
// (get) Token: 0x0600195A RID: 6490 RVA: 0x000615CC File Offset: 0x0005F7CC
public override Assembly Assembly
{
get
{
return this.elementType.Assembly;
}
}
// Token: 0x17000470 RID: 1136
// (get) Token: 0x0600195B RID: 6491 RVA: 0x000615DC File Offset: 0x0005F7DC
public override string AssemblyQualifiedName
{
get
{
string text = this.FormatName(this.elementType.FullName);
if (text == null)
{
return null;
}
return text + ", " + this.elementType.Assembly.FullName;
}
}
// Token: 0x17000471 RID: 1137
// (get) Token: 0x0600195C RID: 6492 RVA: 0x00061620 File Offset: 0x0005F820
public override string FullName
{
get
{
return this.FormatName(this.elementType.FullName);
}
}
// Token: 0x17000472 RID: 1138
// (get) Token: 0x0600195D RID: 6493 RVA: 0x00061634 File Offset: 0x0005F834
public override string Name
{
get
{
return this.FormatName(this.elementType.Name);
}
}
// Token: 0x17000473 RID: 1139
// (get) Token: 0x0600195E RID: 6494 RVA: 0x00061648 File Offset: 0x0005F848
public override Guid GUID
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x17000474 RID: 1140
// (get) Token: 0x0600195F RID: 6495 RVA: 0x00061650 File Offset: 0x0005F850
public override Module Module
{
get
{
return this.elementType.Module;
}
}
// Token: 0x17000475 RID: 1141
// (get) Token: 0x06001960 RID: 6496 RVA: 0x00061660 File Offset: 0x0005F860
public override string Namespace
{
get
{
return this.elementType.Namespace;
}
}
// Token: 0x17000476 RID: 1142
// (get) Token: 0x06001961 RID: 6497 RVA: 0x00061670 File Offset: 0x0005F870
public override RuntimeTypeHandle TypeHandle
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x17000477 RID: 1143
// (get) Token: 0x06001962 RID: 6498 RVA: 0x00061678 File Offset: 0x0005F878
public override Type UnderlyingSystemType
{
get
{
DerivedType.create_unmanaged_type(this);
return this;
}
}
// Token: 0x06001963 RID: 6499 RVA: 0x00061684 File Offset: 0x0005F884
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001964 RID: 6500 RVA: 0x0006168C File Offset: 0x0005F88C
public override object[] GetCustomAttributes(bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001965 RID: 6501 RVA: 0x00061694 File Offset: 0x0005F894
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x0400078B RID: 1931
internal Type elementType;
}
}
@@ -0,0 +1,168 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Provides support for alternative ways to generate the Microsoft intermediate language (MSIL) and metadata for a dynamic method, including methods for creating tokens and for inserting the code, exception handling, and local variable signature blobs. </summary>
// Token: 0x020001EB RID: 491
[ComVisible(true)]
public class DynamicILInfo
{
// Token: 0x06001978 RID: 6520 RVA: 0x0006183C File Offset: 0x0005FA3C
internal DynamicILInfo()
{
}
/// <summary>Gets the dynamic method whose body is generated by the current instance.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.DynamicMethod" /> object representing the dynamic method for which the current <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object is generating code.</returns>
// Token: 0x1700047B RID: 1147
// (get) Token: 0x06001979 RID: 6521 RVA: 0x00061844 File Offset: 0x0005FA44
[MonoTODO]
public DynamicMethod DynamicMethod
{
get
{
throw new NotImplementedException();
}
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing the signature for the associated dynamic method.</summary>
/// <returns>A token that can be embedded in the metadata and the MSIL stream for the associated dynamic method.</returns>
/// <param name="signature">A <see cref="T:System.Byte" /> array containing the signature.</param>
// Token: 0x0600197A RID: 6522 RVA: 0x0006184C File Offset: 0x0005FA4C
[MonoTODO]
public int GetTokenFor(byte[] signature)
{
throw new NotImplementedException();
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing a dynamic method to be called from the associated method.</summary>
/// <returns>A token that can be embedded in the MSIL stream for the associated dynamic method, as the target of an MSIL instruction.</returns>
/// <param name="method">A <see cref="T:System.Reflection.Emit.DynamicMethod" /> object representing the dynamic method to call.</param>
// Token: 0x0600197B RID: 6523 RVA: 0x00061854 File Offset: 0x0005FA54
[MonoTODO]
public int GetTokenFor(DynamicMethod method)
{
throw new NotImplementedException();
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing a field to be accessed from the associated dynamic method.</summary>
/// <returns>A token that can be used as the operand of an MSIL instruction that accesses fields, in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object.</returns>
/// <param name="field">A <see cref="T:System.RuntimeFieldHandle" /> structure representing the field to be accessed.</param>
// Token: 0x0600197C RID: 6524 RVA: 0x0006185C File Offset: 0x0005FA5C
[MonoTODO]
public int GetTokenFor(RuntimeFieldHandle field)
{
throw new NotImplementedException();
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing a method to be accessed from the associated dynamic method.</summary>
/// <returns>A token that can be used as the operand of an MSIL instruction that accesses methods, such as <see cref="F:System.Reflection.Emit.OpCodes.Call" /> or <see cref="F:System.Reflection.Emit.OpCodes.Ldtoken" />, in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object.</returns>
/// <param name="method">A <see cref="T:System.RuntimeMethodHandle" /> structure representing the method to be accessed.</param>
// Token: 0x0600197D RID: 6525 RVA: 0x00061864 File Offset: 0x0005FA64
[MonoTODO]
public int GetTokenFor(RuntimeMethodHandle method)
{
throw new NotImplementedException();
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing a type to be used in the associated dynamic method.</summary>
/// <returns>A token that can be used as the operand of an MSIL instruction that requires a type, in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object.</returns>
/// <param name="type">A <see cref="T:System.RuntimeTypeHandle" /> structure representing the type to be used.</param>
// Token: 0x0600197E RID: 6526 RVA: 0x0006186C File Offset: 0x0005FA6C
[MonoTODO]
public int GetTokenFor(RuntimeTypeHandle type)
{
throw new NotImplementedException();
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing a string literal to be used in the associated dynamic method.</summary>
/// <returns>A token that can be used as the operand of an MSIL instruction that requires a string, in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object.</returns>
/// <param name="literal">The string to be used.</param>
// Token: 0x0600197F RID: 6527 RVA: 0x00061874 File Offset: 0x0005FA74
[MonoTODO]
public int GetTokenFor(string literal)
{
throw new NotImplementedException();
}
/// <summary>Gets a token, valid in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" />, representing a method on a generic type.</summary>
/// <returns>A token that can be used as the operand of an MSIL instruction that accesses methods, such as <see cref="F:System.Reflection.Emit.OpCodes.Call" /> or <see cref="F:System.Reflection.Emit.OpCodes.Ldtoken" />, in the scope of the current <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object.</returns>
/// <param name="method">A <see cref="T:System.RuntimeMethodHandle" /> structure representing the method.</param>
/// <param name="contextType">The generic type the method belongs to.</param>
// Token: 0x06001980 RID: 6528 RVA: 0x0006187C File Offset: 0x0005FA7C
[MonoTODO]
public int GetTokenFor(RuntimeMethodHandle method, RuntimeTypeHandle contextType)
{
throw new NotImplementedException();
}
/// <summary>Sets the code body of the associated dynamic method.</summary>
/// <param name="code">A <see cref="T:System.Byte" /> array containing the MSIL stream.</param>
/// <param name="maxStackSize">The maximum number of items on the operand stack when the method is executing.</param>
// Token: 0x06001981 RID: 6529 RVA: 0x00061884 File Offset: 0x0005FA84
[MonoTODO]
public void SetCode(byte[] code, int maxStackSize)
{
throw new NotImplementedException();
}
/// <summary>Sets the code body of the associated dynamic method.</summary>
/// <param name="code">A pointer to a byte array containing the MSIL stream.</param>
/// <param name="codeSize">The number of bytes in the MSIL stream.</param>
/// <param name="maxStackSize">The maximum number of items on the operand stack when the method is executing.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="codeSize" /> is less than 0.</exception>
// Token: 0x06001982 RID: 6530 RVA: 0x0006188C File Offset: 0x0005FA8C
[MonoTODO]
[CLSCompliant(false)]
public unsafe void SetCode(byte* code, int codeSize, int maxStackSize)
{
throw new NotImplementedException();
}
/// <summary>Sets the exception metadata for the associated dynamic method.</summary>
/// <param name="exceptions">A <see cref="T:System.Byte" /> array containing the exception metadata.</param>
// Token: 0x06001983 RID: 6531 RVA: 0x00061894 File Offset: 0x0005FA94
[MonoTODO]
public void SetExceptions(byte[] exceptions)
{
throw new NotImplementedException();
}
/// <summary>Sets the exception metadata for the associated dynamic method.</summary>
/// <param name="exceptions">A pointer to a byte array containing the exception metadata.</param>
/// <param name="exceptionsSize">The number of bytes of exception metadata.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="exceptionSize" /> is less than 0.</exception>
// Token: 0x06001984 RID: 6532 RVA: 0x0006189C File Offset: 0x0005FA9C
[MonoTODO]
[CLSCompliant(false)]
public unsafe void SetExceptions(byte* exceptions, int exceptionsSize)
{
throw new NotImplementedException();
}
/// <summary>Sets the local variable signature that describes the layout of local variables for the associated dynamic method.</summary>
/// <param name="localSignature">A <see cref="T:System.Byte" /> array containing the layout of local variables for the associated <see cref="T:System.Reflection.Emit.DynamicMethod" />.</param>
// Token: 0x06001985 RID: 6533 RVA: 0x000618A4 File Offset: 0x0005FAA4
[MonoTODO]
public void SetLocalSignature(byte[] localSignature)
{
throw new NotImplementedException();
}
/// <summary>Sets the local variable signature that describes the layout of local variables for the associated dynamic method.</summary>
/// <param name="localSignature">A <see cref="T:System.Byte" /> array containing the layout of local variables for the associated <see cref="T:System.Reflection.Emit.DynamicMethod" />.</param>
/// <param name="signatureSize">The number of bytes in the signature.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="signatureSize" /> is less than 0.</exception>
// Token: 0x06001986 RID: 6534 RVA: 0x000618AC File Offset: 0x0005FAAC
[MonoTODO]
[CLSCompliant(false)]
public unsafe void SetLocalSignature(byte* localSignature, int signatureSize)
{
throw new NotImplementedException();
}
}
}
@@ -0,0 +1,710 @@
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines and represents a dynamic method that can be compiled, executed, and discarded. Discarded methods are available for garbage collection.</summary>
// Token: 0x020001EC RID: 492
[ComVisible(true)]
public sealed class DynamicMethod : MethodInfo
{
/// <summary>Creates a dynamic method that is global to a module, specifying the method name, return type, parameter types, and module.</summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null. </param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="m">A <see cref="T:System.Reflection.Module" /> representing the module with which the dynamic method is to be logically associated. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />. -or-<paramref name="m" /> is a module that provides anonymous hosting for dynamic methods.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-<paramref name="m" /> is null.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x06001987 RID: 6535 RVA: 0x000618B4 File Offset: 0x0005FAB4
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Module m)
: this(name, returnType, parameterTypes, m, false)
{
}
/// <summary>Creates a dynamic method, specifying the method name, return type, parameter types, and the type with which the dynamic method is logically associated.</summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null. </param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="owner">A <see cref="T:System.Type" /> with which the dynamic method is logically associated. The dynamic method has access to all members of the type. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />.-or- <paramref name="owner" /> is an interface, an array, an open generic type, or a type parameter of a generic type or method. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-<paramref name="owner" /> is null.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is null, or is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x06001988 RID: 6536 RVA: 0x000618C4 File Offset: 0x0005FAC4
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner)
: this(name, returnType, parameterTypes, owner, false)
{
}
/// <summary>Creates a dynamic method that is global to a module, specifying the method name, return type, parameter types, module, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.</summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null. </param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="m">A <see cref="T:System.Reflection.Module" /> representing the module with which the dynamic method is to be logically associated. </param>
/// <param name="skipVisibility">true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />. -or-<paramref name="m" /> is a module that provides anonymous hosting for dynamic methods.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-<paramref name="m" /> is null.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x06001989 RID: 6537 RVA: 0x000618D4 File Offset: 0x0005FAD4
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Module m, bool skipVisibility)
: this(name, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, m, skipVisibility)
{
}
/// <summary>Creates a dynamic method, specifying the method name, return type, parameter types, the type with which the dynamic method is logically associated, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.</summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null. </param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="owner">A <see cref="T:System.Type" /> with which the dynamic method is logically associated. The dynamic method has access to all members of the type.</param>
/// <param name="skipVisibility">true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />.-or- <paramref name="owner" /> is an interface, an array, an open generic type, or a type parameter of a generic type or method.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-<paramref name="owner" /> is null.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is null, or is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x0600198A RID: 6538 RVA: 0x000618F4 File Offset: 0x0005FAF4
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner, bool skipVisibility)
: this(name, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, owner, skipVisibility)
{
}
/// <summary>Creates a dynamic method, specifying the method name, attributes, calling convention, return type, parameter types, the type with which the dynamic method is logically associated, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.</summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null.</param>
/// <param name="attributes">A bitwise combination of <see cref="T:System.Reflection.MethodAttributes" /> values that specifies the attributes of the dynamic method. The only combination allowed is <see cref="F:System.Reflection.MethodAttributes.Public" /> and <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
/// <param name="callingConvention">The calling convention for the dynamic method. Must be <see cref="F:System.Reflection.CallingConventions.Standard" />.</param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="owner">A <see cref="T:System.Type" /> with which the dynamic method is logically associated. The dynamic method has access to all members of the type.</param>
/// <param name="skipVisibility">true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false.</param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />. -or-<paramref name="owner" /> is an interface, an array, an open generic type, or a type parameter of a generic type or method.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-<paramref name="owner" /> is null.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="attributes" /> is a combination of flags other than <see cref="F:System.Reflection.MethodAttributes.Public" /> and <see cref="F:System.Reflection.MethodAttributes.Static" />.-or-<paramref name="callingConvention" /> is not <see cref="F:System.Reflection.CallingConventions.Standard" />.-or-<paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x0600198B RID: 6539 RVA: 0x00061914 File Offset: 0x0005FB14
public DynamicMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type owner, bool skipVisibility)
: this(name, attributes, callingConvention, returnType, parameterTypes, owner, owner.Module, skipVisibility, false)
{
}
/// <summary>Creates a dynamic method that is global to a module, specifying the method name, attributes, calling convention, return type, parameter types, module, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method.</summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null.</param>
/// <param name="attributes">A bitwise combination of <see cref="T:System.Reflection.MethodAttributes" /> values that specifies the attributes of the dynamic method. The only combination allowed is <see cref="F:System.Reflection.MethodAttributes.Public" /> and <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
/// <param name="callingConvention">The calling convention for the dynamic method. Must be <see cref="F:System.Reflection.CallingConventions.Standard" />.</param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="m">A <see cref="T:System.Reflection.Module" /> representing the module with which the dynamic method is to be logically associated. </param>
/// <param name="skipVisibility">true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />.-or-<paramref name="m" /> is a module that provides anonymous hosting for dynamic methods.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-<paramref name="m" /> is null.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="attributes" /> is a combination of flags other than <see cref="F:System.Reflection.MethodAttributes.Public" /> and <see cref="F:System.Reflection.MethodAttributes.Static" />.-or-<paramref name="callingConvention" /> is not <see cref="F:System.Reflection.CallingConventions.Standard" />.-or-<paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x0600198C RID: 6540 RVA: 0x0006193C File Offset: 0x0005FB3C
public DynamicMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Module m, bool skipVisibility)
: this(name, attributes, callingConvention, returnType, parameterTypes, null, m, skipVisibility, false)
{
}
/// <summary>Initializes an anonymously hosted dynamic method, specifying the method name, return type, and parameter types. </summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null. </param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x0600198D RID: 6541 RVA: 0x0006195C File Offset: 0x0005FB5C
public DynamicMethod(string name, Type returnType, Type[] parameterTypes)
: this(name, returnType, parameterTypes, false)
{
}
/// <summary>Initializes an anonymously hosted dynamic method, specifying the method name, return type, parameter types, and whether just-in-time (JIT) visibility checks should be skipped for types and members accessed by the Microsoft intermediate language (MSIL) of the dynamic method. </summary>
/// <param name="name">The name of the dynamic method. This can be a zero-length string, but it cannot be null. </param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or null if the method has no return type. </param>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects specifying the types of the parameters of the dynamic method, or null if the method has no parameters. </param>
/// <param name="restrictedSkipVisibility">true to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method, with this restriction: the trust level of the assemblies that contain those types and members must be equal to or less than the trust level of the call stack that emits the dynamic method; otherwise, false. </param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is null or <see cref="T:System.Void" />.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns true. </exception>
// Token: 0x0600198E RID: 6542 RVA: 0x00061968 File Offset: 0x0005FB68
[MonoTODO("Visibility is not restricted")]
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, bool restrictedSkipVisibility)
: this(name, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static, CallingConventions.Standard, returnType, parameterTypes, null, null, restrictedSkipVisibility, true)
{
}
// Token: 0x0600198F RID: 6543 RVA: 0x00061988 File Offset: 0x0005FB88
private DynamicMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type owner, Module m, bool skipVisibility, bool anonHosted)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (returnType == null)
{
returnType = typeof(void);
}
if (m == null && !anonHosted)
{
throw new ArgumentNullException("m");
}
if (returnType.IsByRef)
{
throw new ArgumentException("Return type can't be a byref type", "returnType");
}
if (parameterTypes != null)
{
for (int i = 0; i < parameterTypes.Length; i++)
{
if (parameterTypes[i] == null)
{
throw new ArgumentException("Parameter " + i + " is null", "parameterTypes");
}
}
}
if (m == null)
{
m = DynamicMethod.AnonHostModuleHolder.anon_host_module;
}
this.name = name;
this.attributes = attributes | MethodAttributes.Static;
this.callingConvention = callingConvention;
this.returnType = returnType;
this.parameters = parameterTypes;
this.owner = owner;
this.module = m;
this.skipVisibility = skipVisibility;
}
// Token: 0x06001990 RID: 6544
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void create_dynamic_method(DynamicMethod m);
// Token: 0x06001991 RID: 6545
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void destroy_dynamic_method(DynamicMethod m);
// Token: 0x06001992 RID: 6546 RVA: 0x00061A90 File Offset: 0x0005FC90
private void CreateDynMethod()
{
if (this.mhandle.Value == IntPtr.Zero)
{
if (this.ilgen == null || ILGenerator.Mono_GetCurrentOffset(this.ilgen) == 0)
{
throw new InvalidOperationException("Method '" + this.name + "' does not have a method body.");
}
this.ilgen.label_fixup();
try
{
this.creating = true;
if (this.refs != null)
{
for (int i = 0; i < this.refs.Length; i++)
{
if (this.refs[i] is DynamicMethod)
{
DynamicMethod dynamicMethod = (DynamicMethod)this.refs[i];
if (!dynamicMethod.creating)
{
dynamicMethod.CreateDynMethod();
}
}
}
}
}
finally
{
this.creating = false;
}
this.create_dynamic_method(this);
}
}
// Token: 0x06001993 RID: 6547 RVA: 0x00061B84 File Offset: 0x0005FD84
~DynamicMethod()
{
this.destroy_dynamic_method(this);
}
/// <summary>Completes the dynamic method and creates a delegate that can be used to execute it.</summary>
/// <returns>A delegate of the specified type, which can be used to execute the dynamic method.</returns>
/// <param name="delegateType">A delegate type whose signature matches that of the dynamic method. </param>
/// <exception cref="T:System.InvalidOperationException">The dynamic method has no method body.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="delegateType" /> has the wrong number of parameters or the wrong parameter types.</exception>
// Token: 0x06001994 RID: 6548 RVA: 0x00061BC0 File Offset: 0x0005FDC0
[ComVisible(true)]
public Delegate CreateDelegate(Type delegateType)
{
if (delegateType == null)
{
throw new ArgumentNullException("delegateType");
}
if (this.deleg != null)
{
return this.deleg;
}
this.CreateDynMethod();
this.deleg = Delegate.CreateDelegate(delegateType, this);
return this.deleg;
}
/// <summary>Completes the dynamic method and creates a delegate that can be used to execute it, specifying the delegate type and an object the delegate is bound to.</summary>
/// <returns>A delegate of the specified type, which can be used to execute the dynamic method with the specified target object.</returns>
/// <param name="delegateType">A delegate type whose signature matches that of the dynamic method, minus the first parameter.</param>
/// <param name="target">An object the delegate is bound to. Must be of the same type as the first parameter of the dynamic method. </param>
/// <exception cref="T:System.InvalidOperationException">The dynamic method has no method body.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="target" /> is not the same type as the first parameter of the dynamic method, and is not assignable to that type.-or-<paramref name="delegateType" /> has the wrong number of parameters or the wrong parameter types.</exception>
// Token: 0x06001995 RID: 6549 RVA: 0x00061C0C File Offset: 0x0005FE0C
[ComVisible(true)]
public Delegate CreateDelegate(Type delegateType, object target)
{
if (delegateType == null)
{
throw new ArgumentNullException("delegateType");
}
this.CreateDynMethod();
return Delegate.CreateDelegate(delegateType, target, this);
}
/// <summary>Defines a parameter of the dynamic method.</summary>
/// <returns>Always returns null. </returns>
/// <param name="position">The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter. </param>
/// <param name="attributes">A bitwise combination of <see cref="T:System.Reflection.ParameterAttributes" /> values that specifies the attributes of the parameter. </param>
/// <param name="parameterName">The name of the parameter. The name can be a zero-length string. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The method has no parameters.-or- <paramref name="position" /> is less than 0.-or- <paramref name="position" /> is greater than the number of the method's parameters. </exception>
// Token: 0x06001996 RID: 6550 RVA: 0x00061C30 File Offset: 0x0005FE30
public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, string parameterName)
{
if (position < 0 || position > this.parameters.Length)
{
throw new ArgumentOutOfRangeException("position");
}
this.RejectIfCreated();
ParameterBuilder parameterBuilder = new ParameterBuilder(this, position, attributes, parameterName);
if (this.pinfo == null)
{
this.pinfo = new ParameterBuilder[this.parameters.Length + 1];
}
this.pinfo[position] = parameterBuilder;
return parameterBuilder;
}
/// <summary>Returns the base implementation for the method.</summary>
/// <returns>The base implementation of the method.</returns>
// Token: 0x06001997 RID: 6551 RVA: 0x00061C98 File Offset: 0x0005FE98
public override MethodInfo GetBaseDefinition()
{
return this;
}
/// <summary>Returns all the custom attributes defined for the method.</summary>
/// <returns>An array of objects representing all the custom attributes of the method.</returns>
/// <param name="inherit">true to search the method's inheritance chain to find the custom attributes; false to check only the current method. </param>
// Token: 0x06001998 RID: 6552 RVA: 0x00061C9C File Offset: 0x0005FE9C
[MonoTODO("Not implemented")]
public override object[] GetCustomAttributes(bool inherit)
{
throw new NotImplementedException();
}
/// <summary>Returns the custom attributes of the specified type that have been applied to the method.</summary>
/// <returns>An array of objects representing the attributes of the method that are of type <paramref name="attributeType" /> or derive from type <paramref name="attributeType" />.</returns>
/// <param name="attributeType">A <see cref="T:System.Type" /> representing the type of custom attribute to return. </param>
/// <param name="inherit">true to search the method's inheritance chain to find the custom attributes; false to check only the current method. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="attributeType" /> is null.</exception>
// Token: 0x06001999 RID: 6553 RVA: 0x00061CA4 File Offset: 0x0005FEA4
[MonoTODO("Not implemented")]
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw new NotImplementedException();
}
/// <summary>Returns a <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object that can be used to generate a method body from metadata tokens, scopes, and Microsoft intermediate language (MSIL) streams.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.DynamicILInfo" /> object that can be used to generate a method body from metadata tokens, scopes, and MSIL streams.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x0600199A RID: 6554 RVA: 0x00061CAC File Offset: 0x0005FEAC
[MonoTODO("Not implemented")]
public DynamicILInfo GetDynamicILInfo()
{
throw new NotImplementedException();
}
/// <summary>Returns a Microsoft intermediate language (MSIL) generator for the method with a default MSIL stream size of 64 bytes.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.ILGenerator" /> object for the method.</returns>
// Token: 0x0600199B RID: 6555 RVA: 0x00061CB4 File Offset: 0x0005FEB4
public ILGenerator GetILGenerator()
{
return this.GetILGenerator(64);
}
/// <summary>Returns a Microsoft intermediate language (MSIL) generator for the method with the specified MSIL stream size.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.ILGenerator" /> object for the method, with the specified MSIL stream size.</returns>
/// <param name="streamSize">The size of the MSIL stream, in bytes. </param>
// Token: 0x0600199C RID: 6556 RVA: 0x00061CC0 File Offset: 0x0005FEC0
public ILGenerator GetILGenerator(int streamSize)
{
if ((this.GetMethodImplementationFlags() & MethodImplAttributes.CodeTypeMask) != MethodImplAttributes.IL || (this.GetMethodImplementationFlags() & MethodImplAttributes.ManagedMask) != MethodImplAttributes.IL)
{
throw new InvalidOperationException("Method body should not exist.");
}
if (this.ilgen != null)
{
return this.ilgen;
}
this.ilgen = new ILGenerator(this.Module, new DynamicMethodTokenGenerator(this), streamSize);
return this.ilgen;
}
/// <summary>Returns the implementation flags for the method.</summary>
/// <returns>A bitwise combination of <see cref="T:System.Reflection.MethodImplAttributes" /> values representing the implementation flags for the method.</returns>
// Token: 0x0600199D RID: 6557 RVA: 0x00061D24 File Offset: 0x0005FF24
public override MethodImplAttributes GetMethodImplementationFlags()
{
return MethodImplAttributes.IL;
}
/// <summary>Returns the parameters of the dynamic method.</summary>
/// <returns>An array of <see cref="T:System.Reflection.ParameterInfo" /> objects that represent the parameters of the dynamic method.</returns>
// Token: 0x0600199E RID: 6558 RVA: 0x00061D28 File Offset: 0x0005FF28
public override ParameterInfo[] GetParameters()
{
if (this.parameters == null)
{
return new ParameterInfo[0];
}
ParameterInfo[] array = new ParameterInfo[this.parameters.Length];
for (int i = 0; i < this.parameters.Length; i++)
{
array[i] = new ParameterInfo((this.pinfo != null) ? this.pinfo[i + 1] : null, this.parameters[i], this, i + 1);
}
return array;
}
/// <summary>Invokes the dynamic method using the specified parameters, under the constraints of the specified binder, with the specified culture information.</summary>
/// <returns>A <see cref="T:System.Object" /> containing the return value of the invoked method.</returns>
/// <param name="obj">This parameter is ignored for dynamic methods, because they are static. Specify null. </param>
/// <param name="invokeAttr">A bitwise combination of <see cref="T:System.Reflection.BindingFlags" /> values.</param>
/// <param name="binder">A <see cref="T:System.Reflection.Binder" /> object that enables the binding, coercion of argument types, invocation of members, and retrieval of <see cref="T:System.Reflection.MemberInfo" /> objects through reflection. If <paramref name="binder" /> is null, the default binder is used. For more details, see <see cref="T:System.Reflection.Binder" />. </param>
/// <param name="parameters">An argument list. This is an array of arguments with the same number, order, and type as the parameters of the method to be invoked. If there are no parameters this parameter should be null. </param>
/// <param name="culture">An instance of <see cref="T:System.Globalization.CultureInfo" /> used to govern the coercion of types. If this is null, the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used. For example, this information is needed to correctly convert a <see cref="T:System.String" /> that represents 1000 to a <see cref="T:System.Double" /> value, because 1000 is represented differently by different cultures. </param>
/// <exception cref="T:System.NotSupportedException">The <see cref="F:System.Reflection.CallingConventions.VarArgs" /> calling convention is not supported.</exception>
/// <exception cref="T:System.Reflection.TargetParameterCountException">The number of elements in <paramref name="parameters" /> does not match the number of parameters in the dynamic method.</exception>
/// <exception cref="T:System.ArgumentException">The type of one or more elements of <paramref name="parameters" /> does not match the type of the corresponding parameter of the dynamic method.</exception>
/// <exception cref="T:System.Reflection.TargetInvocationException">The dynamic method is associated with a module, is not anonymously hosted, and was constructed with <paramref name="skipVisibility" /> set to false, but the dynamic method accesses members that are not public or internal (Friend in Visual Basic).-or-The dynamic method is anonymously hosted and was constructed with <paramref name="skipVisibility" /> set to false, but it accesses members that are not public.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x0600199F RID: 6559 RVA: 0x00061DA0 File Offset: 0x0005FFA0
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
object obj2;
try
{
this.CreateDynMethod();
if (this.method == null)
{
this.method = new MonoMethod(this.mhandle);
}
obj2 = this.method.Invoke(obj, parameters);
}
catch (MethodAccessException ex)
{
throw new TargetInvocationException("Method cannot be invoked.", ex);
}
return obj2;
}
/// <summary>Indicates whether the specified custom attribute type is defined.</summary>
/// <returns>true if the specified custom attribute type is defined; otherwise, false.</returns>
/// <param name="attributeType">A <see cref="T:System.Type" /> representing the type of custom attribute to search for. </param>
/// <param name="inherit">true to search the method's inheritance chain to find the custom attributes; false to check only the current method. </param>
// Token: 0x060019A0 RID: 6560 RVA: 0x00061E18 File Offset: 0x00060018
[MonoTODO("Not implemented")]
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new NotImplementedException();
}
/// <summary>Returns the signature of the method, represented as a string.</summary>
/// <returns>A string representing the method signature.</returns>
// Token: 0x060019A1 RID: 6561 RVA: 0x00061E20 File Offset: 0x00060020
public override string ToString()
{
string text = string.Empty;
ParameterInfo[] array = this.GetParameters();
for (int i = 0; i < array.Length; i++)
{
if (i > 0)
{
text += ", ";
}
text += array[i].ParameterType.Name;
}
return string.Concat(new string[]
{
this.ReturnType.Name,
" ",
this.Name,
"(",
text,
")"
});
}
/// <summary>Gets the attributes specified when the dynamic method was created.</summary>
/// <returns>A bitwise combination of the <see cref="T:System.Reflection.MethodAttributes" /> values representing the attributes for the method.</returns>
// Token: 0x1700047C RID: 1148
// (get) Token: 0x060019A2 RID: 6562 RVA: 0x00061EB4 File Offset: 0x000600B4
public override MethodAttributes Attributes
{
get
{
return this.attributes;
}
}
/// <summary>Gets the calling convention specified when the dynamic method was created.</summary>
/// <returns>One of the <see cref="T:System.Reflection.CallingConventions" /> values that indicates the calling convention of the method.</returns>
// Token: 0x1700047D RID: 1149
// (get) Token: 0x060019A3 RID: 6563 RVA: 0x00061EBC File Offset: 0x000600BC
public override CallingConventions CallingConvention
{
get
{
return this.callingConvention;
}
}
/// <summary>Gets the type that declares the method, which is always null for dynamic methods.</summary>
/// <returns>Always null.</returns>
// Token: 0x1700047E RID: 1150
// (get) Token: 0x060019A4 RID: 6564 RVA: 0x00061EC4 File Offset: 0x000600C4
public override Type DeclaringType
{
get
{
return null;
}
}
/// <summary>Gets or sets a value indicating whether the local variables in the method are zero-initialized. </summary>
/// <returns>true if the local variables in the method are zero-initialized; otherwise, false. The default is true.</returns>
// Token: 0x1700047F RID: 1151
// (get) Token: 0x060019A5 RID: 6565 RVA: 0x00061EC8 File Offset: 0x000600C8
// (set) Token: 0x060019A6 RID: 6566 RVA: 0x00061ED0 File Offset: 0x000600D0
public bool InitLocals
{
get
{
return this.init_locals;
}
set
{
this.init_locals = value;
}
}
/// <summary>Not supported for dynamic methods.</summary>
/// <returns>Not supported for dynamic methods.</returns>
/// <exception cref="T:System.InvalidOperationException">Not allowed for dynamic methods.</exception>
// Token: 0x17000480 RID: 1152
// (get) Token: 0x060019A7 RID: 6567 RVA: 0x00061EDC File Offset: 0x000600DC
public override RuntimeMethodHandle MethodHandle
{
get
{
return this.mhandle;
}
}
/// <summary>Gets the module with which the dynamic method is logically associated.</summary>
/// <returns>The <see cref="T:System.Reflection.Module" /> with which the current dynamic method is associated.</returns>
// Token: 0x17000481 RID: 1153
// (get) Token: 0x060019A8 RID: 6568 RVA: 0x00061EE4 File Offset: 0x000600E4
public override Module Module
{
get
{
return this.module;
}
}
/// <summary>Gets the name of the dynamic method.</summary>
/// <returns>The simple name of the method.</returns>
// Token: 0x17000482 RID: 1154
// (get) Token: 0x060019A9 RID: 6569 RVA: 0x00061EEC File Offset: 0x000600EC
public override string Name
{
get
{
return this.name;
}
}
/// <summary>Gets the class that was used in reflection to obtain the method.</summary>
/// <returns>Always null.</returns>
// Token: 0x17000483 RID: 1155
// (get) Token: 0x060019AA RID: 6570 RVA: 0x00061EF4 File Offset: 0x000600F4
public override Type ReflectedType
{
get
{
return null;
}
}
/// <summary>Gets the return parameter of the dynamic method.</summary>
/// <returns>Always null. </returns>
// Token: 0x17000484 RID: 1156
// (get) Token: 0x060019AB RID: 6571 RVA: 0x00061EF8 File Offset: 0x000600F8
[MonoTODO("Not implemented")]
public override ParameterInfo ReturnParameter
{
get
{
throw new NotImplementedException();
}
}
/// <summary>Gets the type of return value for the dynamic method.</summary>
/// <returns>A <see cref="T:System.Type" /> representing the type of the return value of the current method; <see cref="T:System.Void" /> if the method has no return type.</returns>
// Token: 0x17000485 RID: 1157
// (get) Token: 0x060019AC RID: 6572 RVA: 0x00061F00 File Offset: 0x00060100
public override Type ReturnType
{
get
{
return this.returnType;
}
}
/// <summary>Gets the custom attributes of the return type for the dynamic method.</summary>
/// <returns>An <see cref="T:System.Reflection.ICustomAttributeProvider" /> representing the custom attributes of the return type for the dynamic method.</returns>
// Token: 0x17000486 RID: 1158
// (get) Token: 0x060019AD RID: 6573 RVA: 0x00061F08 File Offset: 0x00060108
[MonoTODO("Not implemented")]
public override ICustomAttributeProvider ReturnTypeCustomAttributes
{
get
{
throw new NotImplementedException();
}
}
// Token: 0x060019AE RID: 6574 RVA: 0x00061F10 File Offset: 0x00060110
private void RejectIfCreated()
{
if (this.mhandle.Value != IntPtr.Zero)
{
throw new InvalidOperationException("Type definition of the method is complete.");
}
}
// Token: 0x060019AF RID: 6575 RVA: 0x00061F38 File Offset: 0x00060138
internal int AddRef(object reference)
{
if (this.refs == null)
{
this.refs = new object[4];
}
if (this.nrefs >= this.refs.Length - 1)
{
object[] array = new object[this.refs.Length * 2];
Array.Copy(this.refs, array, this.refs.Length);
this.refs = array;
}
this.refs[this.nrefs] = reference;
this.refs[this.nrefs + 1] = null;
this.nrefs += 2;
return this.nrefs - 1;
}
// Token: 0x0400078D RID: 1933
private RuntimeMethodHandle mhandle;
// Token: 0x0400078E RID: 1934
private string name;
// Token: 0x0400078F RID: 1935
private Type returnType;
// Token: 0x04000790 RID: 1936
private Type[] parameters;
// Token: 0x04000791 RID: 1937
private MethodAttributes attributes;
// Token: 0x04000792 RID: 1938
private CallingConventions callingConvention;
// Token: 0x04000793 RID: 1939
private Module module;
// Token: 0x04000794 RID: 1940
private bool skipVisibility;
// Token: 0x04000795 RID: 1941
private bool init_locals = true;
// Token: 0x04000796 RID: 1942
private ILGenerator ilgen;
// Token: 0x04000797 RID: 1943
private int nrefs;
// Token: 0x04000798 RID: 1944
private object[] refs;
// Token: 0x04000799 RID: 1945
private IntPtr referenced_by;
// Token: 0x0400079A RID: 1946
private Type owner;
// Token: 0x0400079B RID: 1947
private Delegate deleg;
// Token: 0x0400079C RID: 1948
private MonoMethod method;
// Token: 0x0400079D RID: 1949
private ParameterBuilder[] pinfo;
// Token: 0x0400079E RID: 1950
internal bool creating;
// Token: 0x020001ED RID: 493
private class AnonHostModuleHolder
{
// Token: 0x060019B1 RID: 6577 RVA: 0x00061FD8 File Offset: 0x000601D8
static AnonHostModuleHolder()
{
AssemblyName assemblyName = new AssemblyName();
assemblyName.Name = "Anonymously Hosted DynamicMethods Assembly";
AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
DynamicMethod.AnonHostModuleHolder.anon_host_module = assemblyBuilder.GetManifestModule();
}
// Token: 0x0400079F RID: 1951
public static Module anon_host_module;
}
}
}
@@ -0,0 +1,41 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001EE RID: 494
internal class DynamicMethodTokenGenerator : TokenGenerator
{
// Token: 0x060019B2 RID: 6578 RVA: 0x00062010 File Offset: 0x00060210
public DynamicMethodTokenGenerator(DynamicMethod m)
{
this.m = m;
}
// Token: 0x060019B3 RID: 6579 RVA: 0x00062020 File Offset: 0x00060220
public int GetToken(string str)
{
return this.m.AddRef(str);
}
// Token: 0x060019B4 RID: 6580 RVA: 0x00062030 File Offset: 0x00060230
public int GetToken(MethodInfo method, Type[] opt_param_types)
{
throw new InvalidOperationException();
}
// Token: 0x060019B5 RID: 6581 RVA: 0x00062038 File Offset: 0x00060238
public int GetToken(MemberInfo member)
{
return this.m.AddRef(member);
}
// Token: 0x060019B6 RID: 6582 RVA: 0x00062048 File Offset: 0x00060248
public int GetToken(SignatureHelper helper)
{
return this.m.AddRef(helper);
}
// Token: 0x040007A0 RID: 1952
private DynamicMethod m;
}
}
@@ -0,0 +1,648 @@
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes and represents an enumeration type.</summary>
// Token: 0x020001EF RID: 495
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_EnumBuilder))]
[ComVisible(true)]
public sealed class EnumBuilder : Type, _EnumBuilder
{
// Token: 0x060019B7 RID: 6583 RVA: 0x00062058 File Offset: 0x00060258
internal EnumBuilder(ModuleBuilder mb, string name, TypeAttributes visibility, Type underlyingType)
{
this._tb = new TypeBuilder(mb, name, visibility | TypeAttributes.Sealed, typeof(Enum), null, PackingSize.Unspecified, 0, null);
this._underlyingType = underlyingType;
this._underlyingField = this._tb.DefineField("value__", underlyingType, FieldAttributes.Private | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName);
this.setup_enum_type(this._tb);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019B8 RID: 6584 RVA: 0x000620C0 File Offset: 0x000602C0
void _EnumBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019B9 RID: 6585 RVA: 0x000620C8 File Offset: 0x000602C8
void _EnumBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019BA RID: 6586 RVA: 0x000620D0 File Offset: 0x000602D0
void _EnumBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019BB RID: 6587 RVA: 0x000620D8 File Offset: 0x000602D8
void _EnumBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x060019BC RID: 6588 RVA: 0x000620E0 File Offset: 0x000602E0
internal TypeBuilder GetTypeBuilder()
{
return this._tb;
}
/// <summary>Retrieves the dynamic assembly that contains this enum definition.</summary>
/// <returns>Read-only. The dynamic assembly that contains this enum definition.</returns>
// Token: 0x17000487 RID: 1159
// (get) Token: 0x060019BD RID: 6589 RVA: 0x000620E8 File Offset: 0x000602E8
public override Assembly Assembly
{
get
{
return this._tb.Assembly;
}
}
/// <summary>Returns the full path of this enum qualified by the display name of the parent assembly.</summary>
/// <returns>Read-only. The full path of this enum qualified by the display name of the parent assembly.</returns>
/// <exception cref="T:System.NotSupportedException">If <see cref="M:System.Reflection.Emit.EnumBuilder.CreateType" /> has not been called previously. </exception>
// Token: 0x17000488 RID: 1160
// (get) Token: 0x060019BE RID: 6590 RVA: 0x000620F8 File Offset: 0x000602F8
public override string AssemblyQualifiedName
{
get
{
return this._tb.AssemblyQualifiedName;
}
}
/// <summary>Returns the parent <see cref="T:System.Type" /> of this type which is always <see cref="T:System.Enum" />.</summary>
/// <returns>Read-only. The parent <see cref="T:System.Type" /> of this type.</returns>
// Token: 0x17000489 RID: 1161
// (get) Token: 0x060019BF RID: 6591 RVA: 0x00062108 File Offset: 0x00060308
public override Type BaseType
{
get
{
return this._tb.BaseType;
}
}
/// <summary>Returns the type that declared this <see cref="T:System.Reflection.Emit.EnumBuilder" />.</summary>
/// <returns>Read-only. The type that declared this <see cref="T:System.Reflection.Emit.EnumBuilder" />.</returns>
// Token: 0x1700048A RID: 1162
// (get) Token: 0x060019C0 RID: 6592 RVA: 0x00062118 File Offset: 0x00060318
public override Type DeclaringType
{
get
{
return this._tb.DeclaringType;
}
}
/// <summary>Returns the full path of this enum.</summary>
/// <returns>Read-only. The full path of this enum.</returns>
// Token: 0x1700048B RID: 1163
// (get) Token: 0x060019C1 RID: 6593 RVA: 0x00062128 File Offset: 0x00060328
public override string FullName
{
get
{
return this._tb.FullName;
}
}
/// <summary>Returns the GUID of this enum.</summary>
/// <returns>Read-only. The GUID of this enum.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x1700048C RID: 1164
// (get) Token: 0x060019C2 RID: 6594 RVA: 0x00062138 File Offset: 0x00060338
public override Guid GUID
{
get
{
return this._tb.GUID;
}
}
/// <summary>Retrieves the dynamic module that contains this <see cref="T:System.Reflection.Emit.EnumBuilder" /> definition.</summary>
/// <returns>Read-only. The dynamic module that contains this <see cref="T:System.Reflection.Emit.EnumBuilder" /> definition.</returns>
// Token: 0x1700048D RID: 1165
// (get) Token: 0x060019C3 RID: 6595 RVA: 0x00062148 File Offset: 0x00060348
public override Module Module
{
get
{
return this._tb.Module;
}
}
/// <summary>Returns the name of this enum.</summary>
/// <returns>Read-only. The name of this enum.</returns>
// Token: 0x1700048E RID: 1166
// (get) Token: 0x060019C4 RID: 6596 RVA: 0x00062158 File Offset: 0x00060358
public override string Name
{
get
{
return this._tb.Name;
}
}
/// <summary>Returns the namespace of this enum.</summary>
/// <returns>Read-only. The namespace of this enum.</returns>
// Token: 0x1700048F RID: 1167
// (get) Token: 0x060019C5 RID: 6597 RVA: 0x00062168 File Offset: 0x00060368
public override string Namespace
{
get
{
return this._tb.Namespace;
}
}
/// <summary>Returns the type that was used to obtain this <see cref="T:System.Reflection.Emit.EnumBuilder" />.</summary>
/// <returns>Read-only. The type that was used to obtain this <see cref="T:System.Reflection.Emit.EnumBuilder" />.</returns>
// Token: 0x17000490 RID: 1168
// (get) Token: 0x060019C6 RID: 6598 RVA: 0x00062178 File Offset: 0x00060378
public override Type ReflectedType
{
get
{
return this._tb.ReflectedType;
}
}
/// <summary>Retrieves the internal handle for this enum.</summary>
/// <returns>Read-only. The internal handle for this enum.</returns>
/// <exception cref="T:System.NotSupportedException">This property is not currently supported. </exception>
// Token: 0x17000491 RID: 1169
// (get) Token: 0x060019C7 RID: 6599 RVA: 0x00062188 File Offset: 0x00060388
public override RuntimeTypeHandle TypeHandle
{
get
{
return this._tb.TypeHandle;
}
}
/// <summary>Returns the internal metadata type token of this enum.</summary>
/// <returns>Read-only. The type token of this enum.</returns>
// Token: 0x17000492 RID: 1170
// (get) Token: 0x060019C8 RID: 6600 RVA: 0x00062198 File Offset: 0x00060398
public TypeToken TypeToken
{
get
{
return this._tb.TypeToken;
}
}
/// <summary>Returns the underlying field for this enum.</summary>
/// <returns>Read-only. The underlying field for this enum.</returns>
// Token: 0x17000493 RID: 1171
// (get) Token: 0x060019C9 RID: 6601 RVA: 0x000621A8 File Offset: 0x000603A8
public FieldBuilder UnderlyingField
{
get
{
return this._underlyingField;
}
}
/// <summary>Returns the underlying system type for this enum.</summary>
/// <returns>Read-only. Returns the underlying system type.</returns>
// Token: 0x17000494 RID: 1172
// (get) Token: 0x060019CA RID: 6602 RVA: 0x000621B0 File Offset: 0x000603B0
public override Type UnderlyingSystemType
{
get
{
return this._underlyingType;
}
}
/// <summary>Creates a <see cref="T:System.Type" /> object for this enum.</summary>
/// <returns>A <see cref="T:System.Type" /> object for this enum.</returns>
/// <exception cref="T:System.InvalidOperationException">This type has been previously created.-or- The enclosing type has not been created. </exception>
// Token: 0x060019CB RID: 6603 RVA: 0x000621B8 File Offset: 0x000603B8
public Type CreateType()
{
return this._tb.CreateType();
}
// Token: 0x060019CC RID: 6604
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void setup_enum_type(Type t);
/// <summary>Defines the named static field in an enumeration type with the specified constant value.</summary>
/// <returns>The defined field.</returns>
/// <param name="literalName">The name of the static field. </param>
/// <param name="literalValue">The constant value of the literal. </param>
// Token: 0x060019CD RID: 6605 RVA: 0x000621D4 File Offset: 0x000603D4
public FieldBuilder DefineLiteral(string literalName, object literalValue)
{
FieldBuilder fieldBuilder = this._tb.DefineField(literalName, this, FieldAttributes.FamANDAssem | FieldAttributes.Family | FieldAttributes.Static | FieldAttributes.Literal);
fieldBuilder.SetConstant(literalValue);
return fieldBuilder;
}
// Token: 0x060019CE RID: 6606 RVA: 0x000621FC File Offset: 0x000603FC
protected override TypeAttributes GetAttributeFlagsImpl()
{
return this._tb.attrs;
}
// Token: 0x060019CF RID: 6607 RVA: 0x0006220C File Offset: 0x0006040C
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
return this._tb.GetConstructor(bindingAttr, binder, callConvention, types, modifiers);
}
/// <summary>Returns an array of <see cref="T:System.Reflection.ConstructorInfo" /> objects representing the public and non-public constructors defined for this class, as specified.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.ConstructorInfo" /> objects representing the specified constructors defined for this class. If no constructors are defined, an empty array is returned.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019D0 RID: 6608 RVA: 0x00062220 File Offset: 0x00060420
[ComVisible(true)]
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
return this._tb.GetConstructors(bindingAttr);
}
/// <summary>Returns all the custom attributes defined for this constructor.</summary>
/// <returns>Returns an array of objects representing all the custom attributes of the constructor represented by this <see cref="T:System.Reflection.Emit.ConstructorBuilder" /> instance.</returns>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019D1 RID: 6609 RVA: 0x00062230 File Offset: 0x00060430
public override object[] GetCustomAttributes(bool inherit)
{
return this._tb.GetCustomAttributes(inherit);
}
/// <summary>Returns the custom attributes identified by the given type.</summary>
/// <returns>Returns an array of objects representing the attributes of this constructor that are of <see cref="T:System.Type" /><paramref name="attributeType" />.</returns>
/// <param name="attributeType">The Type object to which the custom attributes are applied. </param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019D2 RID: 6610 RVA: 0x00062240 File Offset: 0x00060440
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return this._tb.GetCustomAttributes(attributeType, inherit);
}
/// <summary>Calling this method always throws <see cref="T:System.NotSupportedException" />.</summary>
/// <returns>This method is not supported. No value is returned.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. </exception>
// Token: 0x060019D3 RID: 6611 RVA: 0x00062250 File Offset: 0x00060450
public override Type GetElementType()
{
return this._tb.GetElementType();
}
/// <summary>Returns the event with the specified name.</summary>
/// <returns>Returns an <see cref="T:System.Reflection.EventInfo" /> object representing the event declared or inherited by this type with the specified name. If there are no matches, null is returned.</returns>
/// <param name="name">The name of the event to get. </param>
/// <param name="bindingAttr">This invocation attribute. This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019D4 RID: 6612 RVA: 0x00062260 File Offset: 0x00060460
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
{
return this._tb.GetEvent(name, bindingAttr);
}
/// <summary>Returns the events for the public events declared or inherited by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.EventInfo" /> objects representing the public events declared or inherited by this type. An empty array is returned if there are no public events.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019D5 RID: 6613 RVA: 0x00062270 File Offset: 0x00060470
public override EventInfo[] GetEvents()
{
return this._tb.GetEvents();
}
/// <summary>Returns the public and non-public events that are declared by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.EventInfo" /> objects representing the public and non-public events declared or inherited by this type. An empty array is returned if there are no events, as specified.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, such as InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019D6 RID: 6614 RVA: 0x00062280 File Offset: 0x00060480
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
return this._tb.GetEvents(bindingAttr);
}
/// <summary>Returns the field specified by the given name.</summary>
/// <returns>Returns the <see cref="T:System.Reflection.FieldInfo" /> object representing the field declared or inherited by this type with the specified name and public or non-public modifier. If there are no matches, then null is returned.</returns>
/// <param name="name">The name of the field to get. </param>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019D7 RID: 6615 RVA: 0x00062290 File Offset: 0x00060490
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
{
return this._tb.GetField(name, bindingAttr);
}
/// <summary>Returns the public and non-public fields that are declared by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.FieldInfo" /> objects representing the public and non-public fields declared or inherited by this type. An empty array is returned if there are no fields, as specified.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, such as InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019D8 RID: 6616 RVA: 0x000622A0 File Offset: 0x000604A0
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
return this._tb.GetFields(bindingAttr);
}
/// <summary>Returns the interface implemented (directly or indirectly) by this type, with the specified fully-qualified name.</summary>
/// <returns>Returns a <see cref="T:System.Type" /> object representing the implemented interface. Returns null if no interface matching name is found.</returns>
/// <param name="name">The name of the interface. </param>
/// <param name="ignoreCase">If true, the search is case-insensitive. If false, the search is case-sensitive. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019D9 RID: 6617 RVA: 0x000622B0 File Offset: 0x000604B0
public override Type GetInterface(string name, bool ignoreCase)
{
return this._tb.GetInterface(name, ignoreCase);
}
/// <summary>Returns an interface mapping for the interface requested.</summary>
/// <returns>The requested interface mapping.</returns>
/// <param name="interfaceType">The type of the interface for which the interface mapping is to be retrieved. </param>
/// <exception cref="T:System.ArgumentException">The type does not implement the interface. </exception>
// Token: 0x060019DA RID: 6618 RVA: 0x000622C0 File Offset: 0x000604C0
[ComVisible(true)]
public override InterfaceMapping GetInterfaceMap(Type interfaceType)
{
return this._tb.GetInterfaceMap(interfaceType);
}
/// <summary>Returns an array of all the interfaces implemented on this a class and its base classes.</summary>
/// <returns>Returns an array of <see cref="T:System.Type" /> objects representing the implemented interfaces. If none are defined, an empty array is returned.</returns>
// Token: 0x060019DB RID: 6619 RVA: 0x000622D0 File Offset: 0x000604D0
public override Type[] GetInterfaces()
{
return this._tb.GetInterfaces();
}
/// <summary>Returns all members with the specified name, type, and binding that are declared or inherited by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.MemberInfo" /> objects representing the public and non-public members defined on this type if <paramref name="nonPublic" /> is used; otherwise, only the public members are returned.</returns>
/// <param name="name">The name of the member. </param>
/// <param name="type">The type of member that is to be returned. </param>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019DC RID: 6620 RVA: 0x000622E0 File Offset: 0x000604E0
public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
{
return this._tb.GetMember(name, type, bindingAttr);
}
/// <summary>Returns the specified members declared or inherited by this type,.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.MemberInfo" /> objects representing the public and non-public members declared or inherited by this type. An empty array is returned if there are no matching members.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019DD RID: 6621 RVA: 0x000622F0 File Offset: 0x000604F0
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
return this._tb.GetMembers(bindingAttr);
}
// Token: 0x060019DE RID: 6622 RVA: 0x00062300 File Offset: 0x00060500
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
if (types == null)
{
return this._tb.GetMethod(name, bindingAttr);
}
return this._tb.GetMethod(name, bindingAttr, binder, callConvention, types, modifiers);
}
/// <summary>Returns all the public and non-public methods declared or inherited by this type, as specified.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.MethodInfo" /> objects representing the public and non-public methods defined on this type if <paramref name="nonPublic" /> is used; otherwise, only the public methods are returned.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, such as InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019DF RID: 6623 RVA: 0x00062338 File Offset: 0x00060538
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
return this._tb.GetMethods(bindingAttr);
}
/// <summary>Returns the specified nested type that is declared by this type.</summary>
/// <returns>A <see cref="T:System.Type" /> object representing the nested type that matches the specified requirements, if found; otherwise, null.</returns>
/// <param name="name">The <see cref="T:System.String" /> containing the name of the nested type to get. </param>
/// <param name="bindingAttr">A bitmask comprised of one or more <see cref="T:System.Reflection.BindingFlags" /> that specify how the search is conducted.-or- Zero, to conduct a case-sensitive search for public methods. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019E0 RID: 6624 RVA: 0x00062348 File Offset: 0x00060548
public override Type GetNestedType(string name, BindingFlags bindingAttr)
{
return this._tb.GetNestedType(name, bindingAttr);
}
/// <summary>Returns the public and non-public nested types that are declared or inherited by this type.</summary>
/// <returns>An array of <see cref="T:System.Type" /> objects representing all the types nested within the current <see cref="T:System.Type" /> that match the specified binding constraints.An empty array of type <see cref="T:System.Type" />, if no types are nested within the current <see cref="T:System.Type" />, or if none of the nested types match the binding constraints.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, such as InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019E1 RID: 6625 RVA: 0x00062358 File Offset: 0x00060558
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
return this._tb.GetNestedTypes(bindingAttr);
}
/// <summary>Returns all the public and non-public properties declared or inherited by this type, as specified.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.PropertyInfo" /> objects representing the public and non-public properties defined on this type if <paramref name="nonPublic" /> is used; otherwise, only the public properties are returned.</returns>
/// <param name="bindingAttr">This invocation attribute. This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x060019E2 RID: 6626 RVA: 0x00062368 File Offset: 0x00060568
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
return this._tb.GetProperties(bindingAttr);
}
// Token: 0x060019E3 RID: 6627 RVA: 0x00062378 File Offset: 0x00060578
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{
throw this.CreateNotSupportedException();
}
// Token: 0x060019E4 RID: 6628 RVA: 0x00062380 File Offset: 0x00060580
protected override bool HasElementTypeImpl()
{
return this._tb.HasElementType;
}
/// <summary>Invokes the specified member. The method that is to be invoked must be accessible and provide the most specific match with the specified argument list, under the contraints of the specified binder and invocation attributes.</summary>
/// <returns>Returns the return value of the invoked member.</returns>
/// <param name="name">The name of the member to invoke. This can be a constructor, method, property, or field. A suitable invocation attribute must be specified. Note that it is possible to invoke the default member of a class by passing an empty string as the name of the member. </param>
/// <param name="invokeAttr">The invocation attribute. This must be a bit flag from BindingFlags. </param>
/// <param name="binder">An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is null, the default binder is used. See <see cref="T:System.Reflection.Binder" />. </param>
/// <param name="target">The object on which to invoke the specified member. If the member is static, this parameter is ignored. </param>
/// <param name="args">An argument list. This is an array of objects that contains the number, order, and type of the parameters of the member to be invoked. If there are no parameters this should be null. </param>
/// <param name="modifiers">An array of the same length as <paramref name="args" /> with elements that represent the attributes associated with the arguments of the member to be invoked. A parameter has attributes associated with it in the metadata. They are used by various interoperability services. See the metadata specs for details such as this. </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. (Note that this is necessary to, for example, convert a string that represents 1000 to a double value, since 1000 is represented differently by different cultures.) </param>
/// <param name="namedParameters">Each parameter in the <paramref name="namedParameters" /> array gets the value in the corresponding element in the <paramref name="args" /> array. If the length of <paramref name="args" /> is greater than the length of <paramref name="namedParameters" />, the remaining argument values are passed in order. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x060019E5 RID: 6629 RVA: 0x00062390 File Offset: 0x00060590
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
{
return this._tb.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
}
// Token: 0x060019E6 RID: 6630 RVA: 0x000623B8 File Offset: 0x000605B8
protected override bool IsArrayImpl()
{
return false;
}
// Token: 0x060019E7 RID: 6631 RVA: 0x000623BC File Offset: 0x000605BC
protected override bool IsByRefImpl()
{
return false;
}
// Token: 0x060019E8 RID: 6632 RVA: 0x000623C0 File Offset: 0x000605C0
protected override bool IsCOMObjectImpl()
{
return false;
}
// Token: 0x060019E9 RID: 6633 RVA: 0x000623C4 File Offset: 0x000605C4
protected override bool IsPointerImpl()
{
return false;
}
// Token: 0x060019EA RID: 6634 RVA: 0x000623C8 File Offset: 0x000605C8
protected override bool IsPrimitiveImpl()
{
return false;
}
// Token: 0x060019EB RID: 6635 RVA: 0x000623CC File Offset: 0x000605CC
protected override bool IsValueTypeImpl()
{
return true;
}
/// <summary>Checks if the specified custom attribute type is defined.</summary>
/// <returns>true if one or more instance of <paramref name="attributeType" /> is defined on this member; otherwise, false.</returns>
/// <param name="attributeType">The Type object to which the custom attributes are applied. </param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported in types that are not complete. </exception>
// Token: 0x060019EC RID: 6636 RVA: 0x000623D0 File Offset: 0x000605D0
public override bool IsDefined(Type attributeType, bool inherit)
{
return this._tb.IsDefined(attributeType, inherit);
}
// Token: 0x060019ED RID: 6637 RVA: 0x000623E0 File Offset: 0x000605E0
public override Type MakeArrayType()
{
return new ArrayType(this, 0);
}
/// <param name="rank"></param>
// Token: 0x060019EE RID: 6638 RVA: 0x000623EC File Offset: 0x000605EC
public override Type MakeArrayType(int rank)
{
if (rank < 1)
{
throw new IndexOutOfRangeException();
}
return new ArrayType(this, rank);
}
// Token: 0x060019EF RID: 6639 RVA: 0x00062404 File Offset: 0x00060604
public override Type MakeByRefType()
{
return new ByRefType(this);
}
// Token: 0x060019F0 RID: 6640 RVA: 0x0006240C File Offset: 0x0006060C
public override Type MakePointerType()
{
return new PointerType(this);
}
/// <summary>Sets a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
// Token: 0x060019F1 RID: 6641 RVA: 0x00062414 File Offset: 0x00060614
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
this._tb.SetCustomAttribute(customBuilder);
}
/// <summary>Sets a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
// Token: 0x060019F2 RID: 6642 RVA: 0x00062424 File Offset: 0x00060624
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
// Token: 0x060019F3 RID: 6643 RVA: 0x00062434 File Offset: 0x00060634
private Exception CreateNotSupportedException()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
// Token: 0x040007A1 RID: 1953
private TypeBuilder _tb;
// Token: 0x040007A2 RID: 1954
private FieldBuilder _underlyingField;
// Token: 0x040007A3 RID: 1955
private Type _underlyingType;
}
}
@@ -0,0 +1,259 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines events for a class.</summary>
// Token: 0x020001F0 RID: 496
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_EventBuilder))]
public sealed class EventBuilder : _EventBuilder
{
// Token: 0x060019F4 RID: 6644 RVA: 0x00062440 File Offset: 0x00060640
internal EventBuilder(TypeBuilder tb, string eventName, EventAttributes eventAttrs, Type eventType)
{
this.name = eventName;
this.attrs = eventAttrs;
this.type = eventType;
this.typeb = tb;
this.table_idx = this.get_next_table_index(this, 20, true);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019F5 RID: 6645 RVA: 0x00062478 File Offset: 0x00060678
void _EventBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019F6 RID: 6646 RVA: 0x00062480 File Offset: 0x00060680
void _EventBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019F7 RID: 6647 RVA: 0x00062488 File Offset: 0x00060688
void _EventBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x060019F8 RID: 6648 RVA: 0x00062490 File Offset: 0x00060690
void _EventBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x060019F9 RID: 6649 RVA: 0x00062498 File Offset: 0x00060698
internal int get_next_table_index(object obj, int table, bool inc)
{
return this.typeb.get_next_table_index(obj, table, inc);
}
/// <summary>Adds one of the "other" methods associated with this event. "Other" methods are methods other than the "on" and "raise" methods associated with an event. This function can be called many times to add as many "other" methods.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the other method. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x060019FA RID: 6650 RVA: 0x000624A8 File Offset: 0x000606A8
public void AddOtherMethod(MethodBuilder mdBuilder)
{
if (mdBuilder == null)
{
throw new ArgumentNullException("mdBuilder");
}
this.RejectIfCreated();
if (this.other_methods != null)
{
MethodBuilder[] array = new MethodBuilder[this.other_methods.Length + 1];
this.other_methods.CopyTo(array, 0);
this.other_methods = array;
}
else
{
this.other_methods = new MethodBuilder[1];
}
this.other_methods[this.other_methods.Length - 1] = mdBuilder;
}
/// <summary>Returns the token for this event.</summary>
/// <returns>Returns the EventToken for this event.</returns>
// Token: 0x060019FB RID: 6651 RVA: 0x00062520 File Offset: 0x00060720
public EventToken GetEventToken()
{
return new EventToken(335544320 | this.table_idx);
}
/// <summary>Sets the method used to subscribe to this event.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the method used to subscribe to this event. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x060019FC RID: 6652 RVA: 0x00062534 File Offset: 0x00060734
public void SetAddOnMethod(MethodBuilder mdBuilder)
{
if (mdBuilder == null)
{
throw new ArgumentNullException("mdBuilder");
}
this.RejectIfCreated();
this.add_method = mdBuilder;
}
/// <summary>Sets the method used to raise this event.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the method used to raise this event. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x060019FD RID: 6653 RVA: 0x00062554 File Offset: 0x00060754
public void SetRaiseMethod(MethodBuilder mdBuilder)
{
if (mdBuilder == null)
{
throw new ArgumentNullException("mdBuilder");
}
this.RejectIfCreated();
this.raise_method = mdBuilder;
}
/// <summary>Sets the method used to unsubscribe to this event.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the method used to unsubscribe to this event. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x060019FE RID: 6654 RVA: 0x00062574 File Offset: 0x00060774
public void SetRemoveOnMethod(MethodBuilder mdBuilder)
{
if (mdBuilder == null)
{
throw new ArgumentNullException("mdBuilder");
}
this.RejectIfCreated();
this.remove_method = mdBuilder;
}
/// <summary>Sets a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to describe the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x060019FF RID: 6655 RVA: 0x00062594 File Offset: 0x00060794
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
this.RejectIfCreated();
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Runtime.CompilerServices.SpecialNameAttribute")
{
this.attrs |= EventAttributes.SpecialName;
return;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Set a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x06001A00 RID: 6656 RVA: 0x00062640 File Offset: 0x00060840
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
if (con == null)
{
throw new ArgumentNullException("con");
}
if (binaryAttribute == null)
{
throw new ArgumentNullException("binaryAttribute");
}
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
// Token: 0x06001A01 RID: 6657 RVA: 0x00062674 File Offset: 0x00060874
private void RejectIfCreated()
{
if (this.typeb.is_created)
{
throw new InvalidOperationException("Type definition of the method is complete.");
}
}
// Token: 0x040007A4 RID: 1956
internal string name;
// Token: 0x040007A5 RID: 1957
private Type type;
// Token: 0x040007A6 RID: 1958
private TypeBuilder typeb;
// Token: 0x040007A7 RID: 1959
private CustomAttributeBuilder[] cattrs;
// Token: 0x040007A8 RID: 1960
internal MethodBuilder add_method;
// Token: 0x040007A9 RID: 1961
internal MethodBuilder remove_method;
// Token: 0x040007AA RID: 1962
internal MethodBuilder raise_method;
// Token: 0x040007AB RID: 1963
internal MethodBuilder[] other_methods;
// Token: 0x040007AC RID: 1964
internal EventAttributes attrs;
// Token: 0x040007AD RID: 1965
private int table_idx;
}
}
@@ -0,0 +1,130 @@
using System;
using System.Collections;
namespace System.Reflection.Emit
{
// Token: 0x020001F1 RID: 497
internal class EventOnTypeBuilderInst : EventInfo
{
// Token: 0x06001A02 RID: 6658 RVA: 0x00062694 File Offset: 0x00060894
internal EventOnTypeBuilderInst(MonoGenericClass instantiation, EventBuilder evt)
{
this.instantiation = instantiation;
this.evt = evt;
}
// Token: 0x17000495 RID: 1173
// (get) Token: 0x06001A03 RID: 6659 RVA: 0x000626AC File Offset: 0x000608AC
public override EventAttributes Attributes
{
get
{
return this.evt.attrs;
}
}
// Token: 0x06001A04 RID: 6660 RVA: 0x000626BC File Offset: 0x000608BC
public override MethodInfo GetAddMethod(bool nonPublic)
{
if (this.evt.add_method == null || (!nonPublic && !this.evt.add_method.IsPublic))
{
return null;
}
return TypeBuilder.GetMethod(this.instantiation, this.evt.add_method);
}
// Token: 0x06001A05 RID: 6661 RVA: 0x0006270C File Offset: 0x0006090C
public override MethodInfo GetRaiseMethod(bool nonPublic)
{
if (this.evt.raise_method == null || (!nonPublic && !this.evt.raise_method.IsPublic))
{
return null;
}
return TypeBuilder.GetMethod(this.instantiation, this.evt.raise_method);
}
// Token: 0x06001A06 RID: 6662 RVA: 0x0006275C File Offset: 0x0006095C
public override MethodInfo GetRemoveMethod(bool nonPublic)
{
if (this.evt.remove_method == null || (!nonPublic && !this.evt.remove_method.IsPublic))
{
return null;
}
return TypeBuilder.GetMethod(this.instantiation, this.evt.remove_method);
}
// Token: 0x06001A07 RID: 6663 RVA: 0x000627AC File Offset: 0x000609AC
public override MethodInfo[] GetOtherMethods(bool nonPublic)
{
if (this.evt.other_methods == null)
{
return new MethodInfo[0];
}
ArrayList arrayList = new ArrayList();
foreach (MethodBuilder methodInfo in this.evt.other_methods)
{
if (nonPublic || methodInfo.IsPublic)
{
arrayList.Add(TypeBuilder.GetMethod(this.instantiation, methodInfo));
}
}
MethodInfo[] array = new MethodInfo[arrayList.Count];
arrayList.CopyTo(array, 0);
return array;
}
// Token: 0x17000496 RID: 1174
// (get) Token: 0x06001A08 RID: 6664 RVA: 0x00062838 File Offset: 0x00060A38
public override Type DeclaringType
{
get
{
return this.instantiation;
}
}
// Token: 0x17000497 RID: 1175
// (get) Token: 0x06001A09 RID: 6665 RVA: 0x00062840 File Offset: 0x00060A40
public override string Name
{
get
{
return this.evt.name;
}
}
// Token: 0x17000498 RID: 1176
// (get) Token: 0x06001A0A RID: 6666 RVA: 0x00062850 File Offset: 0x00060A50
public override Type ReflectedType
{
get
{
return this.instantiation;
}
}
// Token: 0x06001A0B RID: 6667 RVA: 0x00062858 File Offset: 0x00060A58
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001A0C RID: 6668 RVA: 0x00062860 File Offset: 0x00060A60
public override object[] GetCustomAttributes(bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001A0D RID: 6669 RVA: 0x00062868 File Offset: 0x00060A68
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x040007AE RID: 1966
private MonoGenericClass instantiation;
// Token: 0x040007AF RID: 1967
private EventBuilder evt;
}
}
@@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents the Token returned by the metadata to represent an event.</summary>
// Token: 0x020001F2 RID: 498
[ComVisible(true)]
[Serializable]
public struct EventToken
{
// Token: 0x06001A0E RID: 6670 RVA: 0x00062870 File Offset: 0x00060A70
internal EventToken(int val)
{
this.tokValue = val;
}
/// <summary>Checks if the given object is an instance of EventToken and is equal to this instance.</summary>
/// <returns>Returns true if <paramref name="obj" /> is an instance of EventToken and equals the current instance; otherwise, false.</returns>
/// <param name="obj">The object to be compared with this instance. </param>
// Token: 0x06001A10 RID: 6672 RVA: 0x00062898 File Offset: 0x00060A98
public override bool Equals(object obj)
{
bool flag = obj is EventToken;
if (flag)
{
EventToken eventToken = (EventToken)obj;
flag = this.tokValue == eventToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.EventToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.EventToken" /> to compare to the current instance.</param>
// Token: 0x06001A11 RID: 6673 RVA: 0x000628D0 File Offset: 0x00060AD0
public bool Equals(EventToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Generates the hash code for this event.</summary>
/// <returns>Returns the hash code for this instance.</returns>
// Token: 0x06001A12 RID: 6674 RVA: 0x000628E4 File Offset: 0x00060AE4
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for this event.</summary>
/// <returns>Read-only. Retrieves the metadata token for this event.</returns>
// Token: 0x17000499 RID: 1177
// (get) Token: 0x06001A13 RID: 6675 RVA: 0x000628EC File Offset: 0x00060AEC
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.EventToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.EventToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.EventToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001A14 RID: 6676 RVA: 0x000628F4 File Offset: 0x00060AF4
public static bool operator ==(EventToken a, EventToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.EventToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.EventToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.EventToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001A15 RID: 6677 RVA: 0x00062908 File Offset: 0x00060B08
public static bool operator !=(EventToken a, EventToken b)
{
return !object.Equals(a, b);
}
// Token: 0x040007B0 RID: 1968
internal int tokValue;
/// <summary>The default EventToken with <see cref="P:System.Reflection.Emit.EventToken.Token" /> value 0.</summary>
// Token: 0x040007B1 RID: 1969
public static readonly EventToken Empty = default(EventToken);
}
}
@@ -0,0 +1,412 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines and represents a field. This class cannot be inherited.</summary>
// Token: 0x020001F3 RID: 499
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_FieldBuilder))]
[ComVisible(true)]
public sealed class FieldBuilder : FieldInfo, _FieldBuilder
{
// Token: 0x06001A16 RID: 6678 RVA: 0x00062920 File Offset: 0x00060B20
internal FieldBuilder(TypeBuilder tb, string fieldName, Type type, FieldAttributes attributes, Type[] modReq, Type[] modOpt)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
this.attrs = attributes;
this.name = fieldName;
this.type = type;
this.modReq = modReq;
this.modOpt = modOpt;
this.offset = -1;
this.typeb = tb;
this.table_idx = tb.get_next_table_index(this, 4, true);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001A17 RID: 6679 RVA: 0x00062988 File Offset: 0x00060B88
void _FieldBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001A18 RID: 6680 RVA: 0x00062990 File Offset: 0x00060B90
void _FieldBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001A19 RID: 6681 RVA: 0x00062998 File Offset: 0x00060B98
void _FieldBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001A1A RID: 6682 RVA: 0x000629A0 File Offset: 0x00060BA0
void _FieldBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Indicates the attributes of this field. This property is read-only.</summary>
/// <returns>The attributes of this field.</returns>
// Token: 0x1700049A RID: 1178
// (get) Token: 0x06001A1B RID: 6683 RVA: 0x000629A8 File Offset: 0x00060BA8
public override FieldAttributes Attributes
{
get
{
return this.attrs;
}
}
/// <summary>Indicates a reference to the <see cref="T:System.Type" /> object for the type that declares this field. This property is read-only.</summary>
/// <returns>A reference to the <see cref="T:System.Type" /> object for the type that declares this field.</returns>
// Token: 0x1700049B RID: 1179
// (get) Token: 0x06001A1C RID: 6684 RVA: 0x000629B0 File Offset: 0x00060BB0
public override Type DeclaringType
{
get
{
return this.typeb;
}
}
/// <summary>Indicates the internal metadata handle for this field. This property is read-only.</summary>
/// <returns>The internal metadata handle for this field.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x1700049C RID: 1180
// (get) Token: 0x06001A1D RID: 6685 RVA: 0x000629B8 File Offset: 0x00060BB8
public override RuntimeFieldHandle FieldHandle
{
get
{
throw this.CreateNotSupportedException();
}
}
/// <summary>Indicates the <see cref="T:System.Type" /> object that represents the type of this field. This property is read-only.</summary>
/// <returns>The <see cref="T:System.Type" /> object that represents the type of this field.</returns>
// Token: 0x1700049D RID: 1181
// (get) Token: 0x06001A1E RID: 6686 RVA: 0x000629C0 File Offset: 0x00060BC0
public override Type FieldType
{
get
{
return this.type;
}
}
/// <summary>Indicates the name of this field. This property is read-only.</summary>
/// <returns>A <see cref="T:System.String" /> containing the name of this field.</returns>
// Token: 0x1700049E RID: 1182
// (get) Token: 0x06001A1F RID: 6687 RVA: 0x000629C8 File Offset: 0x00060BC8
public override string Name
{
get
{
return this.name;
}
}
/// <summary>Indicates the reference to the <see cref="T:System.Type" /> object from which this object was obtained. This property is read-only.</summary>
/// <returns>A reference to the <see cref="T:System.Type" /> object from which this instance was obtained.</returns>
// Token: 0x1700049F RID: 1183
// (get) Token: 0x06001A20 RID: 6688 RVA: 0x000629D0 File Offset: 0x00060BD0
public override Type ReflectedType
{
get
{
return this.typeb;
}
}
/// <summary>Returns all the custom attributes defined for this field.</summary>
/// <returns>An array of type <see cref="T:System.Object" /> representing all the custom attributes of the constructor represented by this <see cref="T:System.Reflection.Emit.FieldBuilder" /> instance.</returns>
/// <param name="inherit">Controls inheritance of custom attributes from base classes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001A21 RID: 6689 RVA: 0x000629D8 File Offset: 0x00060BD8
public override object[] GetCustomAttributes(bool inherit)
{
if (this.typeb.is_created)
{
return MonoCustomAttrs.GetCustomAttributes(this, inherit);
}
throw this.CreateNotSupportedException();
}
/// <summary>Returns all the custom attributes defined for this field identified by the given type.</summary>
/// <returns>An array of type <see cref="T:System.Object" /> representing all the custom attributes of the constructor represented by this <see cref="T:System.Reflection.Emit.FieldBuilder" /> instance.</returns>
/// <param name="attributeType">The custom attribute type. </param>
/// <param name="inherit">Controls inheritance of custom attributes from base classes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001A22 RID: 6690 RVA: 0x000629F8 File Offset: 0x00060BF8
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
if (this.typeb.is_created)
{
return MonoCustomAttrs.GetCustomAttributes(this, attributeType, inherit);
}
throw this.CreateNotSupportedException();
}
/// <summary>Returns the token representing this field.</summary>
/// <returns>Returns the <see cref="T:System.Reflection.Emit.FieldToken" /> object that represents the token for this field.</returns>
// Token: 0x06001A23 RID: 6691 RVA: 0x00062A1C File Offset: 0x00060C1C
public FieldToken GetToken()
{
return new FieldToken(this.MetadataToken);
}
/// <summary>Retrieves the value of the field supported by the given object.</summary>
/// <returns>An <see cref="T:System.Object" /> containing the value of the field reflected by this instance.</returns>
/// <param name="obj">The object on which to access the field. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001A24 RID: 6692 RVA: 0x00062A2C File Offset: 0x00060C2C
public override object GetValue(object obj)
{
throw this.CreateNotSupportedException();
}
/// <summary>Indicates whether an attribute having the specified type is defined on a field.</summary>
/// <returns>true if one or more instance of <paramref name="attributeType" /> is defined on this field; otherwise, false.</returns>
/// <param name="attributeType">The type of the attribute. </param>
/// <param name="inherit">Controls inheritance of custom attributes from base classes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the field using <see cref="M:System.Type.GetField(System.String,System.Reflection.BindingFlags)" /> and call <see cref="M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean)" /> on the returned <see cref="T:System.Reflection.FieldInfo" />. </exception>
// Token: 0x06001A25 RID: 6693 RVA: 0x00062A34 File Offset: 0x00060C34
public override bool IsDefined(Type attributeType, bool inherit)
{
throw this.CreateNotSupportedException();
}
// Token: 0x06001A26 RID: 6694 RVA: 0x00062A3C File Offset: 0x00060C3C
internal override int GetFieldOffset()
{
return 0;
}
// Token: 0x06001A27 RID: 6695 RVA: 0x00062A40 File Offset: 0x00060C40
internal void SetRVAData(byte[] data)
{
this.rva_data = (byte[])data.Clone();
}
/// <summary>Sets the default value of this field.</summary>
/// <param name="defaultValue">The new default value for this field. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
/// <exception cref="T:System.ArgumentException">The field is not one of the supported types.-or-The type of <paramref name="defaultValue" /> does not match the type of the field.-or-The field is of type <see cref="T:System.Object" /> or other reference type, and <paramref name="defaultValue" /> is not null.</exception>
// Token: 0x06001A28 RID: 6696 RVA: 0x00062A54 File Offset: 0x00060C54
public void SetConstant(object defaultValue)
{
this.RejectIfCreated();
this.def_value = defaultValue;
}
/// <summary>Sets a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The parent type of this field is complete. </exception>
// Token: 0x06001A29 RID: 6697 RVA: 0x00062A64 File Offset: 0x00060C64
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
this.RejectIfCreated();
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Runtime.InteropServices.FieldOffsetAttribute")
{
byte[] data = customBuilder.Data;
this.offset = (int)data[2];
this.offset |= (int)data[3] << 8;
this.offset |= (int)data[4] << 16;
this.offset |= (int)data[5] << 24;
return;
}
if (fullName == "System.NonSerializedAttribute")
{
this.attrs |= FieldAttributes.NotSerialized;
return;
}
if (fullName == "System.Runtime.CompilerServices.SpecialNameAttribute")
{
this.attrs |= FieldAttributes.SpecialName;
return;
}
if (fullName == "System.Runtime.InteropServices.MarshalAsAttribute")
{
this.attrs |= FieldAttributes.HasFieldMarshal;
this.marshal_info = CustomAttributeBuilder.get_umarshal(customBuilder, true);
return;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Sets a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The parent type of this field is complete. </exception>
// Token: 0x06001A2A RID: 6698 RVA: 0x00062BAC File Offset: 0x00060DAC
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.RejectIfCreated();
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Describes the native marshaling of the field.</summary>
/// <param name="unmanagedMarshal">A descriptor specifying the native marshalling of this field. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="unmanagedMarshal" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001A2B RID: 6699 RVA: 0x00062BC4 File Offset: 0x00060DC4
[Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public void SetMarshal(UnmanagedMarshal unmanagedMarshal)
{
this.RejectIfCreated();
this.marshal_info = unmanagedMarshal;
this.attrs |= FieldAttributes.HasFieldMarshal;
}
/// <summary>Specifies the field layout.</summary>
/// <param name="iOffset">The offset of the field within the type containing this field. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="iOffset" /> is less than zero.</exception>
// Token: 0x06001A2C RID: 6700 RVA: 0x00062BE8 File Offset: 0x00060DE8
public void SetOffset(int iOffset)
{
this.RejectIfCreated();
this.offset = iOffset;
}
/// <summary>Sets the value of the field supported by the given object.</summary>
/// <param name="obj">The object on which to access the field. </param>
/// <param name="val">The value to assign to the field. </param>
/// <param name="invokeAttr">A member of IBinder that specifies the type of binding that is desired (for example, IBinder.CreateInstance, IBinder.ExactBinding). </param>
/// <param name="binder">A set of properties and enabling for binding, coercion of argument types, and invocation of members using reflection. If binder is null, then IBinder.DefaultBinding is used. </param>
/// <param name="culture">The software preferences of a particular culture. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001A2D RID: 6701 RVA: 0x00062BF8 File Offset: 0x00060DF8
public override void SetValue(object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
{
throw this.CreateNotSupportedException();
}
// Token: 0x170004A0 RID: 1184
// (get) Token: 0x06001A2E RID: 6702 RVA: 0x00062C00 File Offset: 0x00060E00
internal override UnmanagedMarshal UMarshal
{
get
{
return this.marshal_info;
}
}
// Token: 0x06001A2F RID: 6703 RVA: 0x00062C08 File Offset: 0x00060E08
private Exception CreateNotSupportedException()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
// Token: 0x06001A30 RID: 6704 RVA: 0x00062C14 File Offset: 0x00060E14
private void RejectIfCreated()
{
if (this.typeb.is_created)
{
throw new InvalidOperationException("Unable to change after type has been created.");
}
}
/// <summary>Gets the module in which the type that contains this field is being defined.</summary>
/// <returns>A <see cref="T:System.Reflection.Module" /> that represents the dynamic module in which this field is being defined.</returns>
// Token: 0x170004A1 RID: 1185
// (get) Token: 0x06001A31 RID: 6705 RVA: 0x00062C34 File Offset: 0x00060E34
public override Module Module
{
get
{
return base.Module;
}
}
// Token: 0x040007B2 RID: 1970
private FieldAttributes attrs;
// Token: 0x040007B3 RID: 1971
private Type type;
// Token: 0x040007B4 RID: 1972
private string name;
// Token: 0x040007B5 RID: 1973
private object def_value;
// Token: 0x040007B6 RID: 1974
private int offset;
// Token: 0x040007B7 RID: 1975
private int table_idx;
// Token: 0x040007B8 RID: 1976
internal TypeBuilder typeb;
// Token: 0x040007B9 RID: 1977
private byte[] rva_data;
// Token: 0x040007BA RID: 1978
private CustomAttributeBuilder[] cattrs;
// Token: 0x040007BB RID: 1979
private UnmanagedMarshal marshal_info;
// Token: 0x040007BC RID: 1980
private RuntimeFieldHandle handle;
// Token: 0x040007BD RID: 1981
private Type[] modReq;
// Token: 0x040007BE RID: 1982
private Type[] modOpt;
}
}
@@ -0,0 +1,140 @@
using System;
using System.Globalization;
namespace System.Reflection.Emit
{
// Token: 0x020001F4 RID: 500
internal class FieldOnTypeBuilderInst : FieldInfo
{
// Token: 0x06001A32 RID: 6706 RVA: 0x00062C3C File Offset: 0x00060E3C
public FieldOnTypeBuilderInst(MonoGenericClass instantiation, FieldBuilder fb)
{
this.instantiation = instantiation;
this.fb = fb;
}
// Token: 0x170004A2 RID: 1186
// (get) Token: 0x06001A33 RID: 6707 RVA: 0x00062C54 File Offset: 0x00060E54
public override Type DeclaringType
{
get
{
return this.instantiation;
}
}
// Token: 0x170004A3 RID: 1187
// (get) Token: 0x06001A34 RID: 6708 RVA: 0x00062C5C File Offset: 0x00060E5C
public override string Name
{
get
{
return this.fb.Name;
}
}
// Token: 0x170004A4 RID: 1188
// (get) Token: 0x06001A35 RID: 6709 RVA: 0x00062C6C File Offset: 0x00060E6C
public override Type ReflectedType
{
get
{
return this.instantiation;
}
}
// Token: 0x06001A36 RID: 6710 RVA: 0x00062C74 File Offset: 0x00060E74
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001A37 RID: 6711 RVA: 0x00062C7C File Offset: 0x00060E7C
public override object[] GetCustomAttributes(bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001A38 RID: 6712 RVA: 0x00062C84 File Offset: 0x00060E84
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001A39 RID: 6713 RVA: 0x00062C8C File Offset: 0x00060E8C
public override string ToString()
{
if (!((ModuleBuilder)this.instantiation.generic_type.Module).assemblyb.IsCompilerContext)
{
return this.fb.FieldType.ToString() + " " + this.Name;
}
return this.FieldType.ToString() + " " + this.Name;
}
// Token: 0x170004A5 RID: 1189
// (get) Token: 0x06001A3A RID: 6714 RVA: 0x00062CFC File Offset: 0x00060EFC
public override FieldAttributes Attributes
{
get
{
return this.fb.Attributes;
}
}
// Token: 0x170004A6 RID: 1190
// (get) Token: 0x06001A3B RID: 6715 RVA: 0x00062D0C File Offset: 0x00060F0C
public override RuntimeFieldHandle FieldHandle
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x170004A7 RID: 1191
// (get) Token: 0x06001A3C RID: 6716 RVA: 0x00062D14 File Offset: 0x00060F14
public override int MetadataToken
{
get
{
if (!((ModuleBuilder)this.instantiation.generic_type.Module).assemblyb.IsCompilerContext)
{
throw new InvalidOperationException();
}
return this.fb.MetadataToken;
}
}
// Token: 0x170004A8 RID: 1192
// (get) Token: 0x06001A3D RID: 6717 RVA: 0x00062D4C File Offset: 0x00060F4C
public override Type FieldType
{
get
{
if (!((ModuleBuilder)this.instantiation.generic_type.Module).assemblyb.IsCompilerContext)
{
throw new NotSupportedException();
}
return this.instantiation.InflateType(this.fb.FieldType);
}
}
// Token: 0x06001A3E RID: 6718 RVA: 0x00062D9C File Offset: 0x00060F9C
public override object GetValue(object obj)
{
throw new NotSupportedException();
}
// Token: 0x06001A3F RID: 6719 RVA: 0x00062DA4 File Offset: 0x00060FA4
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
{
throw new NotSupportedException();
}
// Token: 0x040007BF RID: 1983
internal MonoGenericClass instantiation;
// Token: 0x040007C0 RID: 1984
internal FieldBuilder fb;
}
}
@@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>The FieldToken struct is an object representation of a token that represents a field.</summary>
// Token: 0x020001F5 RID: 501
[ComVisible(true)]
[Serializable]
public struct FieldToken
{
// Token: 0x06001A40 RID: 6720 RVA: 0x00062DAC File Offset: 0x00060FAC
internal FieldToken(int val)
{
this.tokValue = val;
}
/// <summary>Determines if an object is an instance of FieldToken and is equal to this instance.</summary>
/// <returns>Returns true if <paramref name="obj" /> is an instance of FieldToken and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare to this FieldToken. </param>
// Token: 0x06001A42 RID: 6722 RVA: 0x00062DD4 File Offset: 0x00060FD4
public override bool Equals(object obj)
{
bool flag = obj is FieldToken;
if (flag)
{
FieldToken fieldToken = (FieldToken)obj;
flag = this.tokValue == fieldToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.FieldToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.FieldToken" /> to compare to the current instance.</param>
// Token: 0x06001A43 RID: 6723 RVA: 0x00062E0C File Offset: 0x0006100C
public bool Equals(FieldToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Generates the hash code for this field.</summary>
/// <returns>Returns the hash code for this instance.</returns>
// Token: 0x06001A44 RID: 6724 RVA: 0x00062E20 File Offset: 0x00061020
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for this field.</summary>
/// <returns>Read-only. Retrieves the metadata token of this field.</returns>
// Token: 0x170004A9 RID: 1193
// (get) Token: 0x06001A45 RID: 6725 RVA: 0x00062E28 File Offset: 0x00061028
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.FieldToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.FieldToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.FieldToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001A46 RID: 6726 RVA: 0x00062E30 File Offset: 0x00061030
public static bool operator ==(FieldToken a, FieldToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.FieldToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.FieldToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.FieldToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001A47 RID: 6727 RVA: 0x00062E44 File Offset: 0x00061044
public static bool operator !=(FieldToken a, FieldToken b)
{
return !object.Equals(a, b);
}
// Token: 0x040007C1 RID: 1985
internal int tokValue;
/// <summary>The default FieldToken with <see cref="P:System.Reflection.Emit.FieldToken.Token" /> value 0.</summary>
// Token: 0x040007C2 RID: 1986
public static readonly FieldToken Empty = default(FieldToken);
}
}
@@ -0,0 +1,41 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes how an instruction alters the flow of control.</summary>
// Token: 0x020001F6 RID: 502
[ComVisible(true)]
[Serializable]
public enum FlowControl
{
/// <summary>Branch instruction.</summary>
// Token: 0x040007C4 RID: 1988
Branch,
/// <summary>Break instruction.</summary>
// Token: 0x040007C5 RID: 1989
Break,
/// <summary>Call instruction.</summary>
// Token: 0x040007C6 RID: 1990
Call,
/// <summary>Conditional branch instruction.</summary>
// Token: 0x040007C7 RID: 1991
Cond_Branch,
/// <summary>Provides information about a subsequent instruction. For example, the Unaligned instruction of Reflection.Emit.Opcodes has FlowControl.Meta and specifies that the subsequent pointer instruction might be unaligned.</summary>
// Token: 0x040007C8 RID: 1992
Meta,
/// <summary>Normal flow of control.</summary>
// Token: 0x040007C9 RID: 1993
Next,
/// <summary>This enumerator value is reserved and should not be used.</summary>
// Token: 0x040007CA RID: 1994
[Obsolete("This API has been deprecated.")]
Phi,
/// <summary>Return instruction.</summary>
// Token: 0x040007CB RID: 1995
Return,
/// <summary>Exception throw instruction.</summary>
// Token: 0x040007CC RID: 1996
Throw
}
}
@@ -0,0 +1,789 @@
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines and creates generic type parameters for dynamically defined generic types and methods. This class cannot be inherited. </summary>
// Token: 0x020001F7 RID: 503
[ComVisible(true)]
public sealed class GenericTypeParameterBuilder : Type
{
// Token: 0x06001A48 RID: 6728 RVA: 0x00062E5C File Offset: 0x0006105C
internal GenericTypeParameterBuilder(TypeBuilder tbuilder, MethodBuilder mbuilder, string name, int index)
{
this.tbuilder = tbuilder;
this.mbuilder = mbuilder;
this.name = name;
this.index = index;
this.initialize();
}
/// <summary>Sets the base type that a type must inherit in order to be substituted for the type parameter.</summary>
/// <param name="baseTypeConstraint">The <see cref="T:System.Type" /> that must be inherited by any type that is to be substituted for the type parameter.</param>
// Token: 0x06001A49 RID: 6729 RVA: 0x00062E88 File Offset: 0x00061088
public void SetBaseTypeConstraint(Type baseTypeConstraint)
{
this.base_type = baseTypeConstraint ?? typeof(object);
}
/// <summary>Sets the interfaces a type must implement in order to be substituted for the type parameter. </summary>
/// <param name="interfaceConstraints">An array of <see cref="T:System.Type" /> objects that represent the interfaces a type must implement in order to be substituted for the type parameter.</param>
// Token: 0x06001A4A RID: 6730 RVA: 0x00062EA4 File Offset: 0x000610A4
[ComVisible(true)]
public void SetInterfaceConstraints(params Type[] interfaceConstraints)
{
this.iface_constraints = interfaceConstraints;
}
/// <summary>Sets the variance characteristics and special constraints of the generic parameter, such as the parameterless constructor constraint.</summary>
/// <param name="genericParameterAttributes">A bitwise combination of <see cref="T:System.Reflection.GenericParameterAttributes" /> values that represent the variance characteristics and special constraints of the generic type parameter.</param>
// Token: 0x06001A4B RID: 6731 RVA: 0x00062EB0 File Offset: 0x000610B0
public void SetGenericParameterAttributes(GenericParameterAttributes genericParameterAttributes)
{
this.attrs = genericParameterAttributes;
}
// Token: 0x06001A4C RID: 6732
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void initialize();
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="c">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A4D RID: 6733 RVA: 0x00062EBC File Offset: 0x000610BC
[ComVisible(true)]
public override bool IsSubclassOf(Type c)
{
if (!((ModuleBuilder)this.tbuilder.Module).assemblyb.IsCompilerContext)
{
throw this.not_supported();
}
return this.BaseType != null && (this.BaseType == c || this.BaseType.IsSubclassOf(c));
}
// Token: 0x06001A4E RID: 6734 RVA: 0x00062F18 File Offset: 0x00061118
protected override TypeAttributes GetAttributeFlagsImpl()
{
if (((ModuleBuilder)this.tbuilder.Module).assemblyb.IsCompilerContext)
{
return TypeAttributes.Public;
}
throw this.not_supported();
}
// Token: 0x06001A4F RID: 6735 RVA: 0x00062F44 File Offset: 0x00061144
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases. </exception>
// Token: 0x06001A50 RID: 6736 RVA: 0x00062F4C File Offset: 0x0006114C
[ComVisible(true)]
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="name">Not supported.</param>
/// <param name="bindingAttr">Not supported. </param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A51 RID: 6737 RVA: 0x00062F54 File Offset: 0x00061154
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A52 RID: 6738 RVA: 0x00062F5C File Offset: 0x0006115C
public override EventInfo[] GetEvents()
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A53 RID: 6739 RVA: 0x00062F64 File Offset: 0x00061164
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="name">Not supported.</param>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A54 RID: 6740 RVA: 0x00062F6C File Offset: 0x0006116C
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A55 RID: 6741 RVA: 0x00062F74 File Offset: 0x00061174
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="name">The name of the interface.</param>
/// <param name="ignoreCase">true to search without regard for case; false to make a case-sensitive search.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A56 RID: 6742 RVA: 0x00062F7C File Offset: 0x0006117C
public override Type GetInterface(string name, bool ignoreCase)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A57 RID: 6743 RVA: 0x00062F84 File Offset: 0x00061184
public override Type[] GetInterfaces()
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A58 RID: 6744 RVA: 0x00062F8C File Offset: 0x0006118C
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="name">Not supported.</param>
/// <param name="type">Not supported.</param>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A59 RID: 6745 RVA: 0x00062F94 File Offset: 0x00061194
public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A5A RID: 6746 RVA: 0x00062F9C File Offset: 0x0006119C
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
throw this.not_supported();
}
// Token: 0x06001A5B RID: 6747 RVA: 0x00062FA4 File Offset: 0x000611A4
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="name">Not supported.</param>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A5C RID: 6748 RVA: 0x00062FAC File Offset: 0x000611AC
public override Type GetNestedType(string name, BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A5D RID: 6749 RVA: 0x00062FB4 File Offset: 0x000611B4
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="bindingAttr">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A5E RID: 6750 RVA: 0x00062FBC File Offset: 0x000611BC
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
throw this.not_supported();
}
// Token: 0x06001A5F RID: 6751 RVA: 0x00062FC4 File Offset: 0x000611C4
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{
throw this.not_supported();
}
// Token: 0x06001A60 RID: 6752 RVA: 0x00062FCC File Offset: 0x000611CC
protected override bool HasElementTypeImpl()
{
return false;
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="c">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A61 RID: 6753 RVA: 0x00062FD0 File Offset: 0x000611D0
public override bool IsAssignableFrom(Type c)
{
throw this.not_supported();
}
// Token: 0x06001A62 RID: 6754 RVA: 0x00062FD8 File Offset: 0x000611D8
public override bool IsInstanceOfType(object o)
{
throw this.not_supported();
}
// Token: 0x06001A63 RID: 6755 RVA: 0x00062FE0 File Offset: 0x000611E0
protected override bool IsArrayImpl()
{
return false;
}
// Token: 0x06001A64 RID: 6756 RVA: 0x00062FE4 File Offset: 0x000611E4
protected override bool IsByRefImpl()
{
return false;
}
// Token: 0x06001A65 RID: 6757 RVA: 0x00062FE8 File Offset: 0x000611E8
protected override bool IsCOMObjectImpl()
{
return false;
}
// Token: 0x06001A66 RID: 6758 RVA: 0x00062FEC File Offset: 0x000611EC
protected override bool IsPointerImpl()
{
return false;
}
// Token: 0x06001A67 RID: 6759 RVA: 0x00062FF0 File Offset: 0x000611F0
protected override bool IsPrimitiveImpl()
{
return false;
}
// Token: 0x06001A68 RID: 6760 RVA: 0x00062FF4 File Offset: 0x000611F4
protected override bool IsValueTypeImpl()
{
return this.base_type != null && this.base_type.IsValueType;
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="name">Not supported. </param>
/// <param name="invokeAttr">Not supported.</param>
/// <param name="binder">Not supported.</param>
/// <param name="target">Not supported.</param>
/// <param name="args">Not supported.</param>
/// <param name="modifiers">Not supported.</param>
/// <param name="culture">Not supported.</param>
/// <param name="namedParameters">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A69 RID: 6761 RVA: 0x00063014 File Offset: 0x00061214
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
{
throw this.not_supported();
}
/// <summary>Throws a <see cref="T:System.NotSupportedException" /> in all cases. </summary>
/// <returns>The type referred to by the current array type, pointer type, or ByRef type; or null if the current type is not an array type, is not a pointer type, and is not passed by reference.</returns>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A6A RID: 6762 RVA: 0x0006301C File Offset: 0x0006121C
public override Type GetElementType()
{
throw this.not_supported();
}
/// <summary>Gets the current generic type parameter.</summary>
/// <returns>The current <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> object.</returns>
// Token: 0x170004AA RID: 1194
// (get) Token: 0x06001A6B RID: 6763 RVA: 0x00063024 File Offset: 0x00061224
public override Type UnderlyingSystemType
{
get
{
return this;
}
}
/// <summary>Gets an <see cref="T:System.Reflection.Assembly" /> object representing the dynamic assembly that contains the generic type definition the current type parameter belongs to.</summary>
/// <returns>An <see cref="T:System.Reflection.Assembly" /> object representing the dynamic assembly that contains the generic type definition the current type parameter belongs to.</returns>
// Token: 0x170004AB RID: 1195
// (get) Token: 0x06001A6C RID: 6764 RVA: 0x00063028 File Offset: 0x00061228
public override Assembly Assembly
{
get
{
return this.tbuilder.Assembly;
}
}
/// <summary>Gets null in all cases.</summary>
/// <returns>A null reference (Nothing in Visual Basic) in all cases.</returns>
// Token: 0x170004AC RID: 1196
// (get) Token: 0x06001A6D RID: 6765 RVA: 0x00063038 File Offset: 0x00061238
public override string AssemblyQualifiedName
{
get
{
return null;
}
}
/// <summary>Gets the base type constraint of the current generic type parameter.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the base type constraint of the generic type parameter, or null if the type parameter has no base type constraint.</returns>
// Token: 0x170004AD RID: 1197
// (get) Token: 0x06001A6E RID: 6766 RVA: 0x0006303C File Offset: 0x0006123C
public override Type BaseType
{
get
{
return this.base_type;
}
}
/// <summary>Gets null in all cases.</summary>
/// <returns>A null reference (Nothing in Visual Basic) in all cases.</returns>
// Token: 0x170004AE RID: 1198
// (get) Token: 0x06001A6F RID: 6767 RVA: 0x00063044 File Offset: 0x00061244
public override string FullName
{
get
{
return null;
}
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <exception cref="T:System.NotSupportedException">In all cases. </exception>
// Token: 0x170004AF RID: 1199
// (get) Token: 0x06001A70 RID: 6768 RVA: 0x00063048 File Offset: 0x00061248
public override Guid GUID
{
get
{
throw this.not_supported();
}
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="attributeType">Not supported.</param>
/// <param name="inherit">Not supported.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A71 RID: 6769 RVA: 0x00063050 File Offset: 0x00061250
public override bool IsDefined(Type attributeType, bool inherit)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A72 RID: 6770 RVA: 0x00063058 File Offset: 0x00061258
public override object[] GetCustomAttributes(bool inherit)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="attributeType">The type of attribute to search for. Only attributes that are assignable to this type are returned.</param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A73 RID: 6771 RVA: 0x00063060 File Offset: 0x00061260
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw this.not_supported();
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <param name="interfaceType">A <see cref="T:System.Type" /> object that represents the interface type for which the mapping is to be retrieved.</param>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x06001A74 RID: 6772 RVA: 0x00063068 File Offset: 0x00061268
[ComVisible(true)]
public override InterfaceMapping GetInterfaceMap(Type interfaceType)
{
throw this.not_supported();
}
/// <summary>Gets the name of the generic type parameter.</summary>
/// <returns>The name of the generic type parameter.</returns>
// Token: 0x170004B0 RID: 1200
// (get) Token: 0x06001A75 RID: 6773 RVA: 0x00063070 File Offset: 0x00061270
public override string Name
{
get
{
return this.name;
}
}
/// <summary>Gets null in all cases.</summary>
/// <returns>A null reference (Nothing in Visual Basic) in all cases.</returns>
// Token: 0x170004B1 RID: 1201
// (get) Token: 0x06001A76 RID: 6774 RVA: 0x00063078 File Offset: 0x00061278
public override string Namespace
{
get
{
return null;
}
}
/// <summary>Gets the dynamic module that contains the generic type parameter.</summary>
/// <returns>A <see cref="T:System.Reflection.Module" /> object that represents the dynamic module that contains the generic type parameter.</returns>
// Token: 0x170004B2 RID: 1202
// (get) Token: 0x06001A77 RID: 6775 RVA: 0x0006307C File Offset: 0x0006127C
public override Module Module
{
get
{
return this.tbuilder.Module;
}
}
/// <summary>Gets the generic type definition or generic method definition to which the generic type parameter belongs.</summary>
/// <returns>If the type parameter belongs to a generic type, a <see cref="T:System.Type" /> object representing that generic type; if the type parameter belongs to a generic method, a <see cref="T:System.Type" /> object representing that type that declared that generic method.</returns>
// Token: 0x170004B3 RID: 1203
// (get) Token: 0x06001A78 RID: 6776 RVA: 0x0006308C File Offset: 0x0006128C
public override Type DeclaringType
{
get
{
return (this.mbuilder == null) ? this.tbuilder : this.mbuilder.DeclaringType;
}
}
/// <summary>Gets the <see cref="T:System.Type" /> object that was used to obtain the <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" />.</summary>
/// <returns>The <see cref="T:System.Type" /> object that was used to obtain the <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" />.</returns>
// Token: 0x170004B4 RID: 1204
// (get) Token: 0x06001A79 RID: 6777 RVA: 0x000630B0 File Offset: 0x000612B0
public override Type ReflectedType
{
get
{
return this.DeclaringType;
}
}
/// <summary>Not supported for incomplete generic type parameters.</summary>
/// <returns>Not supported for incomplete generic type parameters.</returns>
/// <exception cref="T:System.NotSupportedException">In all cases.</exception>
// Token: 0x170004B5 RID: 1205
// (get) Token: 0x06001A7A RID: 6778 RVA: 0x000630B8 File Offset: 0x000612B8
public override RuntimeTypeHandle TypeHandle
{
get
{
throw this.not_supported();
}
}
/// <summary>Not valid for generic type parameters.</summary>
/// <returns>Not valid for generic type parameters.</returns>
/// <exception cref="T:System.InvalidOperationException">In all cases.</exception>
// Token: 0x06001A7B RID: 6779 RVA: 0x000630C0 File Offset: 0x000612C0
public override Type[] GetGenericArguments()
{
throw new InvalidOperationException();
}
/// <summary>Not valid for generic type parameters.</summary>
/// <returns>Not valid for generic type parameters.</returns>
/// <exception cref="T:System.InvalidOperationException">In all cases.</exception>
// Token: 0x06001A7C RID: 6780 RVA: 0x000630C8 File Offset: 0x000612C8
public override Type GetGenericTypeDefinition()
{
throw new InvalidOperationException();
}
/// <summary>Gets true in all cases.</summary>
/// <returns>true in all cases.</returns>
// Token: 0x170004B6 RID: 1206
// (get) Token: 0x06001A7D RID: 6781 RVA: 0x000630D0 File Offset: 0x000612D0
public override bool ContainsGenericParameters
{
get
{
return true;
}
}
/// <summary>Gets true in all cases.</summary>
/// <returns>true in all cases.</returns>
// Token: 0x170004B7 RID: 1207
// (get) Token: 0x06001A7E RID: 6782 RVA: 0x000630D4 File Offset: 0x000612D4
public override bool IsGenericParameter
{
get
{
return true;
}
}
/// <summary>Returns false in all cases.</summary>
/// <returns>false in all cases.</returns>
// Token: 0x170004B8 RID: 1208
// (get) Token: 0x06001A7F RID: 6783 RVA: 0x000630D8 File Offset: 0x000612D8
public override bool IsGenericType
{
get
{
return false;
}
}
/// <summary>Gets false in all cases.</summary>
/// <returns>false in all cases.</returns>
// Token: 0x170004B9 RID: 1209
// (get) Token: 0x06001A80 RID: 6784 RVA: 0x000630DC File Offset: 0x000612DC
public override bool IsGenericTypeDefinition
{
get
{
return false;
}
}
// Token: 0x170004BA RID: 1210
// (get) Token: 0x06001A81 RID: 6785 RVA: 0x000630E0 File Offset: 0x000612E0
public override GenericParameterAttributes GenericParameterAttributes
{
get
{
if (((ModuleBuilder)this.tbuilder.Module).assemblyb.IsCompilerContext)
{
return this.attrs;
}
throw new NotSupportedException();
}
}
/// <summary>Gets the position of the type parameter in the type parameter list of the generic type or method that declared the parameter.</summary>
/// <returns>The position of the type parameter in the type parameter list of the generic type or method that declared the parameter.</returns>
// Token: 0x170004BB RID: 1211
// (get) Token: 0x06001A82 RID: 6786 RVA: 0x00063110 File Offset: 0x00061310
public override int GenericParameterPosition
{
get
{
return this.index;
}
}
// Token: 0x06001A83 RID: 6787 RVA: 0x00063118 File Offset: 0x00061318
public override Type[] GetGenericParameterConstraints()
{
if (!((ModuleBuilder)this.tbuilder.Module).assemblyb.IsCompilerContext)
{
throw new InvalidOperationException();
}
if (this.base_type == null)
{
if (this.iface_constraints != null)
{
return this.iface_constraints;
}
return Type.EmptyTypes;
}
else
{
if (this.iface_constraints == null)
{
return new Type[] { this.base_type };
}
Type[] array = new Type[this.iface_constraints.Length + 1];
array[0] = this.base_type;
this.iface_constraints.CopyTo(array, 1);
return array;
}
}
/// <summary>Gets a <see cref="T:System.Reflection.MethodInfo" /> that represents the declaring method, if the current <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> represents a type parameter of a generic method.</summary>
/// <returns>A <see cref="T:System.Reflection.MethodInfo" /> that represents the declaring method, if the current <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> represents a type parameter of a generic method; otherwise, null.</returns>
// Token: 0x170004BC RID: 1212
// (get) Token: 0x06001A84 RID: 6788 RVA: 0x000631B0 File Offset: 0x000613B0
public override MethodBase DeclaringMethod
{
get
{
return this.mbuilder;
}
}
/// <summary>Set a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class that defines the custom attribute.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="customBuilder" /> is null.</exception>
// Token: 0x06001A85 RID: 6789 RVA: 0x000631B8 File Offset: 0x000613B8
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Sets a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute.</param>
/// <param name="binaryAttribute">A byte blob representing the attribute.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null.-or-<paramref name="binaryAttribute" /> is a null reference.</exception>
// Token: 0x06001A86 RID: 6790 RVA: 0x0006322C File Offset: 0x0006142C
[MonoTODO("unverified implementation")]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
// Token: 0x06001A87 RID: 6791 RVA: 0x0006323C File Offset: 0x0006143C
private Exception not_supported()
{
return new NotSupportedException();
}
/// <summary>Returns a string representation of the current generic type parameter.</summary>
/// <returns>A string that contains the name of the generic type parameter.</returns>
// Token: 0x06001A88 RID: 6792 RVA: 0x00063244 File Offset: 0x00061444
public override string ToString()
{
return this.name;
}
/// <summary>Tests whether the given object is an instance of EventToken and is equal to the current instance.</summary>
/// <returns>Returns true if <paramref name="o" /> is an instance of EventToken and equals the current instance; otherwise, false.</returns>
/// <param name="o">The object to be compared with the current instance.</param>
// Token: 0x06001A89 RID: 6793 RVA: 0x0006324C File Offset: 0x0006144C
[MonoTODO]
public override bool Equals(object o)
{
return base.Equals(o);
}
/// <summary>Returns a 32-bit integer hash code for the current instance.</summary>
/// <returns>A 32-bit integer hash code.</returns>
// Token: 0x06001A8A RID: 6794 RVA: 0x00063258 File Offset: 0x00061458
[MonoTODO]
public override int GetHashCode()
{
return base.GetHashCode();
}
/// <summary>Returns the type of a one-dimensional array whose element type is the generic type parameter.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the type of a one-dimensional array whose element type is the generic type parameter.</returns>
// Token: 0x06001A8B RID: 6795 RVA: 0x00063260 File Offset: 0x00061460
public override Type MakeArrayType()
{
return new ArrayType(this, 0);
}
/// <summary>Returns the type of an array whose element type is the generic type parameter, with the specified number of dimensions.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the type of an array whose element type is the generic type parameter, with the specified number of dimensions.</returns>
/// <param name="rank">The number of dimensions for the array.</param>
/// <exception cref="T:System.IndexOutOfRangeException">
/// <paramref name="rank" /> is not a valid number of dimensions. For example, its value is less than 1.</exception>
// Token: 0x06001A8C RID: 6796 RVA: 0x0006326C File Offset: 0x0006146C
public override Type MakeArrayType(int rank)
{
if (rank < 1)
{
throw new IndexOutOfRangeException();
}
return new ArrayType(this, rank);
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents the current generic type parameter when passed as a reference parameter.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the current generic type parameter when passed as a reference parameter.</returns>
// Token: 0x06001A8D RID: 6797 RVA: 0x00063284 File Offset: 0x00061484
public override Type MakeByRefType()
{
return new ByRefType(this);
}
/// <summary>Not valid for incomplete generic type parameters.</summary>
/// <returns>This method is invalid for incomplete generic type parameters.</returns>
/// <param name="typeArguments">An array of type arguments.</param>
/// <exception cref="T:System.InvalidOperationException">In all cases.</exception>
// Token: 0x06001A8E RID: 6798 RVA: 0x0006328C File Offset: 0x0006148C
[MonoTODO]
public override Type MakeGenericType(params Type[] typeArguments)
{
return base.MakeGenericType(typeArguments);
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents a pointer to the current generic type parameter.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents a pointer to the current generic type parameter.</returns>
// Token: 0x06001A8F RID: 6799 RVA: 0x00063298 File Offset: 0x00061498
public override Type MakePointerType()
{
return new PointerType(this);
}
// Token: 0x040007CD RID: 1997
private TypeBuilder tbuilder;
// Token: 0x040007CE RID: 1998
private MethodBuilder mbuilder;
// Token: 0x040007CF RID: 1999
private string name;
// Token: 0x040007D0 RID: 2000
private int index;
// Token: 0x040007D1 RID: 2001
private Type base_type;
// Token: 0x040007D2 RID: 2002
private Type[] iface_constraints;
// Token: 0x040007D3 RID: 2003
private CustomAttributeBuilder[] cattrs;
// Token: 0x040007D4 RID: 2004
private GenericParameterAttributes attrs;
}
}
@@ -0,0 +1,43 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001F8 RID: 504
internal struct ILExceptionBlock
{
// Token: 0x06001A90 RID: 6800 RVA: 0x000632A0 File Offset: 0x000614A0
internal void Debug()
{
}
// Token: 0x040007D5 RID: 2005
public const int CATCH = 0;
// Token: 0x040007D6 RID: 2006
public const int FILTER = 1;
// Token: 0x040007D7 RID: 2007
public const int FINALLY = 2;
// Token: 0x040007D8 RID: 2008
public const int FAULT = 4;
// Token: 0x040007D9 RID: 2009
public const int FILTER_START = -1;
// Token: 0x040007DA RID: 2010
internal Type extype;
// Token: 0x040007DB RID: 2011
internal int type;
// Token: 0x040007DC RID: 2012
internal int start;
// Token: 0x040007DD RID: 2013
internal int len;
// Token: 0x040007DE RID: 2014
internal int filter_offset;
}
}
@@ -0,0 +1,127 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001F9 RID: 505
internal struct ILExceptionInfo
{
// Token: 0x06001A91 RID: 6801 RVA: 0x000632A4 File Offset: 0x000614A4
internal int NumHandlers()
{
return this.handlers.Length;
}
// Token: 0x06001A92 RID: 6802 RVA: 0x000632B0 File Offset: 0x000614B0
internal void AddCatch(Type extype, int offset)
{
this.End(offset);
this.add_block(offset);
int num = this.handlers.Length - 1;
this.handlers[num].type = 0;
this.handlers[num].start = offset;
this.handlers[num].extype = extype;
}
// Token: 0x06001A93 RID: 6803 RVA: 0x0006330C File Offset: 0x0006150C
internal void AddFinally(int offset)
{
this.End(offset);
this.add_block(offset);
int num = this.handlers.Length - 1;
this.handlers[num].type = 2;
this.handlers[num].start = offset;
this.handlers[num].extype = null;
}
// Token: 0x06001A94 RID: 6804 RVA: 0x00063368 File Offset: 0x00061568
internal void AddFault(int offset)
{
this.End(offset);
this.add_block(offset);
int num = this.handlers.Length - 1;
this.handlers[num].type = 4;
this.handlers[num].start = offset;
this.handlers[num].extype = null;
}
// Token: 0x06001A95 RID: 6805 RVA: 0x000633C4 File Offset: 0x000615C4
internal void AddFilter(int offset)
{
this.End(offset);
this.add_block(offset);
int num = this.handlers.Length - 1;
this.handlers[num].type = -1;
this.handlers[num].extype = null;
this.handlers[num].filter_offset = offset;
}
// Token: 0x06001A96 RID: 6806 RVA: 0x00063420 File Offset: 0x00061620
internal void End(int offset)
{
if (this.handlers == null)
{
return;
}
int num = this.handlers.Length - 1;
if (num >= 0)
{
this.handlers[num].len = offset - this.handlers[num].start;
}
}
// Token: 0x06001A97 RID: 6807 RVA: 0x00063470 File Offset: 0x00061670
internal int LastClauseType()
{
if (this.handlers != null)
{
return this.handlers[this.handlers.Length - 1].type;
}
return 0;
}
// Token: 0x06001A98 RID: 6808 RVA: 0x0006349C File Offset: 0x0006169C
internal void PatchFilterClause(int start)
{
if (this.handlers != null && this.handlers.Length > 0)
{
this.handlers[this.handlers.Length - 1].start = start;
this.handlers[this.handlers.Length - 1].type = 1;
}
}
// Token: 0x06001A99 RID: 6809 RVA: 0x000634F8 File Offset: 0x000616F8
internal void Debug(int b)
{
}
// Token: 0x06001A9A RID: 6810 RVA: 0x000634FC File Offset: 0x000616FC
private void add_block(int offset)
{
if (this.handlers != null)
{
int num = this.handlers.Length;
ILExceptionBlock[] array = new ILExceptionBlock[num + 1];
Array.Copy(this.handlers, array, num);
this.handlers = array;
this.handlers[num].len = offset - this.handlers[num].start;
}
else
{
this.handlers = new ILExceptionBlock[1];
this.len = offset - this.start;
}
}
// Token: 0x040007DF RID: 2015
private ILExceptionBlock[] handlers;
// Token: 0x040007E0 RID: 2016
internal int start;
// Token: 0x040007E1 RID: 2017
private int len;
// Token: 0x040007E2 RID: 2018
internal Label end;
}
}
@@ -0,0 +1,1229 @@
using System;
using System.Collections;
using System.Diagnostics.SymbolStore;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Generates Microsoft intermediate language (MSIL) instructions.</summary>
// Token: 0x020001FC RID: 508
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
[ComDefaultInterface(typeof(_ILGenerator))]
public class ILGenerator : _ILGenerator
{
// Token: 0x06001A9F RID: 6815 RVA: 0x00063580 File Offset: 0x00061780
internal ILGenerator(Module m, TokenGenerator token_gen, int size)
{
if (size < 0)
{
size = 128;
}
this.code = new byte[size];
this.token_fixups = new ILTokenInfo[8];
this.module = m;
this.token_gen = token_gen;
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array that receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001AA1 RID: 6817 RVA: 0x000635DC File Offset: 0x000617DC
void _ILGenerator.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001AA2 RID: 6818 RVA: 0x000635E4 File Offset: 0x000617E4
void _ILGenerator.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001AA3 RID: 6819 RVA: 0x000635EC File Offset: 0x000617EC
void _ILGenerator.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001AA4 RID: 6820 RVA: 0x000635F4 File Offset: 0x000617F4
void _ILGenerator.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x06001AA5 RID: 6821 RVA: 0x000635FC File Offset: 0x000617FC
private void add_token_fixup(MemberInfo mi)
{
if (this.num_token_fixups == this.token_fixups.Length)
{
ILTokenInfo[] array = new ILTokenInfo[this.num_token_fixups * 2];
this.token_fixups.CopyTo(array, 0);
this.token_fixups = array;
}
this.token_fixups[this.num_token_fixups].member = mi;
this.token_fixups[this.num_token_fixups++].code_pos = this.code_len;
}
// Token: 0x06001AA6 RID: 6822 RVA: 0x0006367C File Offset: 0x0006187C
private void make_room(int nbytes)
{
if (this.code_len + nbytes < this.code.Length)
{
return;
}
byte[] array = new byte[(this.code_len + nbytes) * 2 + 128];
Array.Copy(this.code, 0, array, 0, this.code.Length);
this.code = array;
}
// Token: 0x06001AA7 RID: 6823 RVA: 0x000636D4 File Offset: 0x000618D4
private void emit_int(int val)
{
this.code[this.code_len++] = (byte)(val & 255);
this.code[this.code_len++] = (byte)((val >> 8) & 255);
this.code[this.code_len++] = (byte)((val >> 16) & 255);
this.code[this.code_len++] = (byte)((val >> 24) & 255);
}
// Token: 0x06001AA8 RID: 6824 RVA: 0x0006376C File Offset: 0x0006196C
private void ll_emit(OpCode opcode)
{
if (opcode.Size == 2)
{
this.code[this.code_len++] = opcode.op1;
}
this.code[this.code_len++] = opcode.op2;
switch (opcode.StackBehaviourPush)
{
case StackBehaviour.Push1:
case StackBehaviour.Pushi:
case StackBehaviour.Pushi8:
case StackBehaviour.Pushr4:
case StackBehaviour.Pushr8:
case StackBehaviour.Pushref:
case StackBehaviour.Varpush:
this.cur_stack++;
break;
case StackBehaviour.Push1_push1:
this.cur_stack += 2;
break;
}
if (this.max_stack < this.cur_stack)
{
this.max_stack = this.cur_stack;
}
switch (opcode.StackBehaviourPop)
{
case StackBehaviour.Pop1:
case StackBehaviour.Popi:
case StackBehaviour.Popref:
this.cur_stack--;
break;
case StackBehaviour.Pop1_pop1:
case StackBehaviour.Popi_pop1:
case StackBehaviour.Popi_popi:
case StackBehaviour.Popi_popi8:
case StackBehaviour.Popi_popr4:
case StackBehaviour.Popi_popr8:
case StackBehaviour.Popref_pop1:
case StackBehaviour.Popref_popi:
this.cur_stack -= 2;
break;
case StackBehaviour.Popi_popi_popi:
case StackBehaviour.Popref_popi_popi:
case StackBehaviour.Popref_popi_popi8:
case StackBehaviour.Popref_popi_popr4:
case StackBehaviour.Popref_popi_popr8:
case StackBehaviour.Popref_popi_popref:
this.cur_stack -= 3;
break;
}
}
// Token: 0x06001AA9 RID: 6825 RVA: 0x000638FC File Offset: 0x00061AFC
private static int target_len(OpCode opcode)
{
if (opcode.OperandType == OperandType.InlineBrTarget)
{
return 4;
}
return 1;
}
// Token: 0x06001AAA RID: 6826 RVA: 0x00063910 File Offset: 0x00061B10
private void InternalEndClause()
{
int num = this.ex_handlers[this.cur_block].LastClauseType();
switch (num + 1)
{
case 0:
case 1:
case 2:
this.Emit(OpCodes.Leave, this.ex_handlers[this.cur_block].end);
break;
case 3:
case 5:
this.Emit(OpCodes.Endfinally);
break;
}
}
/// <summary>Begins a catch block.</summary>
/// <param name="exceptionType">The <see cref="T:System.Type" /> object that represents the exception. </param>
/// <exception cref="T:System.ArgumentException">The catch block is within a filtered exception. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="exceptionType" /> is null, and the exception filter block has not returned a value that indicates that finally blocks should be run until this catch block is located. </exception>
/// <exception cref="T:System.NotSupportedException">The Microsoft intermediate language (MSIL) being generated is not currently in an exception block. </exception>
// Token: 0x06001AAB RID: 6827 RVA: 0x00063990 File Offset: 0x00061B90
public virtual void BeginCatchBlock(Type exceptionType)
{
if (this.open_blocks == null)
{
this.open_blocks = new Stack(2);
}
if (this.open_blocks.Count <= 0)
{
throw new NotSupportedException("Not in an exception block");
}
if (exceptionType != null && exceptionType.IsUserType)
{
throw new NotSupportedException("User defined subclasses of System.Type are not yet supported.");
}
if (this.ex_handlers[this.cur_block].LastClauseType() == -1)
{
if (exceptionType != null)
{
throw new ArgumentException("Do not supply an exception type for filter clause");
}
this.Emit(OpCodes.Endfilter);
this.ex_handlers[this.cur_block].PatchFilterClause(this.code_len);
}
else
{
this.InternalEndClause();
this.ex_handlers[this.cur_block].AddCatch(exceptionType, this.code_len);
}
this.cur_stack = 1;
if (this.max_stack < this.cur_stack)
{
this.max_stack = this.cur_stack;
}
}
/// <summary>Begins an exception block for a filtered exception.</summary>
/// <exception cref="T:System.NotSupportedException">The Microsoft intermediate language (MSIL) being generated is not currently in an exception block. -or-This <see cref="T:System.Reflection.Emit.ILGenerator" /> belongs to a <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06001AAC RID: 6828 RVA: 0x00063A8C File Offset: 0x00061C8C
public virtual void BeginExceptFilterBlock()
{
if (this.open_blocks == null)
{
this.open_blocks = new Stack(2);
}
if (this.open_blocks.Count <= 0)
{
throw new NotSupportedException("Not in an exception block");
}
this.InternalEndClause();
this.ex_handlers[this.cur_block].AddFilter(this.code_len);
}
/// <summary>Begins an exception block for a non-filtered exception.</summary>
/// <returns>The label for the end of the block. This will leave you in the correct place to execute finally blocks or to finish the try.</returns>
// Token: 0x06001AAD RID: 6829 RVA: 0x00063AF0 File Offset: 0x00061CF0
public virtual Label BeginExceptionBlock()
{
if (this.open_blocks == null)
{
this.open_blocks = new Stack(2);
}
if (this.ex_handlers != null)
{
this.cur_block = this.ex_handlers.Length;
ILExceptionInfo[] array = new ILExceptionInfo[this.cur_block + 1];
Array.Copy(this.ex_handlers, array, this.cur_block);
this.ex_handlers = array;
}
else
{
this.ex_handlers = new ILExceptionInfo[1];
this.cur_block = 0;
}
this.open_blocks.Push(this.cur_block);
this.ex_handlers[this.cur_block].start = this.code_len;
return this.ex_handlers[this.cur_block].end = this.DefineLabel();
}
/// <summary>Begins an exception fault block in the Microsoft intermediate language (MSIL) stream.</summary>
/// <exception cref="T:System.NotSupportedException">The MSIL being generated is not currently in an exception block. -or-This <see cref="T:System.Reflection.Emit.ILGenerator" /> belongs to a <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06001AAE RID: 6830 RVA: 0x00063BC0 File Offset: 0x00061DC0
public virtual void BeginFaultBlock()
{
if (this.open_blocks == null)
{
this.open_blocks = new Stack(2);
}
if (this.open_blocks.Count <= 0)
{
throw new NotSupportedException("Not in an exception block");
}
if (this.ex_handlers[this.cur_block].LastClauseType() == -1)
{
this.Emit(OpCodes.Leave, this.ex_handlers[this.cur_block].end);
this.ex_handlers[this.cur_block].PatchFilterClause(this.code_len);
}
this.InternalEndClause();
this.ex_handlers[this.cur_block].AddFault(this.code_len);
}
/// <summary>Begins a finally block in the Microsoft intermediate language (MSIL) instruction stream.</summary>
/// <exception cref="T:System.NotSupportedException">The MSIL being generated is not currently in an exception block. </exception>
// Token: 0x06001AAF RID: 6831 RVA: 0x00063C7C File Offset: 0x00061E7C
public virtual void BeginFinallyBlock()
{
if (this.open_blocks == null)
{
this.open_blocks = new Stack(2);
}
if (this.open_blocks.Count <= 0)
{
throw new NotSupportedException("Not in an exception block");
}
this.InternalEndClause();
if (this.ex_handlers[this.cur_block].LastClauseType() == -1)
{
this.Emit(OpCodes.Leave, this.ex_handlers[this.cur_block].end);
this.ex_handlers[this.cur_block].PatchFilterClause(this.code_len);
}
this.ex_handlers[this.cur_block].AddFinally(this.code_len);
}
/// <summary>Begins a lexical scope.</summary>
/// <exception cref="T:System.NotSupportedException">This <see cref="T:System.Reflection.Emit.ILGenerator" /> belongs to a <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06001AB0 RID: 6832 RVA: 0x00063D38 File Offset: 0x00061F38
public virtual void BeginScope()
{
}
/// <summary>Declares a local variable of the specified type.</summary>
/// <returns>The declared local variable.</returns>
/// <param name="localType">A <see cref="T:System.Type" /> object that represents the type of the local variable. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="localType" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created by the <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> method. </exception>
// Token: 0x06001AB1 RID: 6833 RVA: 0x00063D3C File Offset: 0x00061F3C
public virtual LocalBuilder DeclareLocal(Type localType)
{
return this.DeclareLocal(localType, false);
}
/// <summary>Declares a local variable of the specified type, optionally pinning the object referred to by the variable.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.LocalBuilder" /> object that represents the local variable.</returns>
/// <param name="localType">A <see cref="T:System.Type" /> object that represents the type of the local variable.</param>
/// <param name="pinned">true to pin the object in memory; otherwise, false.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="localType" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created by the <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> method.-or-The method body of the enclosing method has been created by the <see cref="M:System.Reflection.Emit.MethodBuilder.CreateMethodBody(System.Byte[],System.Int32)" /> method. </exception>
/// <exception cref="T:System.NotSupportedException">The method with which this <see cref="T:System.Reflection.Emit.ILGenerator" /> is associated is not represented by a <see cref="T:System.Reflection.Emit.MethodBuilder" />.</exception>
// Token: 0x06001AB2 RID: 6834 RVA: 0x00063D48 File Offset: 0x00061F48
public virtual LocalBuilder DeclareLocal(Type localType, bool pinned)
{
if (localType == null)
{
throw new ArgumentNullException("localType");
}
if (localType.IsUserType)
{
throw new NotSupportedException("User defined subclasses of System.Type are not yet supported.");
}
LocalBuilder localBuilder = new LocalBuilder(localType, this);
localBuilder.is_pinned = pinned;
if (this.locals != null)
{
LocalBuilder[] array = new LocalBuilder[this.locals.Length + 1];
Array.Copy(this.locals, array, this.locals.Length);
array[this.locals.Length] = localBuilder;
this.locals = array;
}
else
{
this.locals = new LocalBuilder[1];
this.locals[0] = localBuilder;
}
localBuilder.position = (ushort)(this.locals.Length - 1);
return localBuilder;
}
/// <summary>Declares a new label.</summary>
/// <returns>Returns a new label that can be used as a token for branching.</returns>
// Token: 0x06001AB3 RID: 6835 RVA: 0x00063DF8 File Offset: 0x00061FF8
public virtual Label DefineLabel()
{
if (this.labels == null)
{
this.labels = new ILGenerator.LabelData[4];
}
else if (this.num_labels >= this.labels.Length)
{
ILGenerator.LabelData[] array = new ILGenerator.LabelData[this.labels.Length * 2];
Array.Copy(this.labels, array, this.labels.Length);
this.labels = array;
}
this.labels[this.num_labels] = new ILGenerator.LabelData(-1, 0);
return new Label(this.num_labels++);
}
/// <summary>Puts the specified instruction onto the stream of instructions.</summary>
/// <param name="opcode">The Microsoft Intermediate Language (MSIL) instruction to be put onto the stream. </param>
// Token: 0x06001AB4 RID: 6836 RVA: 0x00063E94 File Offset: 0x00062094
public virtual void Emit(OpCode opcode)
{
this.make_room(2);
this.ll_emit(opcode);
}
/// <summary>Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. </param>
/// <param name="arg">The character argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001AB5 RID: 6837 RVA: 0x00063EA4 File Offset: 0x000620A4
public virtual void Emit(OpCode opcode, byte arg)
{
this.make_room(3);
this.ll_emit(opcode);
this.code[this.code_len++] = arg;
}
/// <summary>Puts the specified instruction and metadata token for the specified constructor onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="con">A ConstructorInfo representing a constructor. </param>
// Token: 0x06001AB6 RID: 6838 RVA: 0x00063ED8 File Offset: 0x000620D8
[ComVisible(true)]
public virtual void Emit(OpCode opcode, ConstructorInfo con)
{
int token = this.token_gen.GetToken(con);
this.make_room(6);
this.ll_emit(opcode);
if (con.DeclaringType.Module == this.module)
{
this.add_token_fixup(con);
}
this.emit_int(token);
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
{
this.cur_stack -= con.GetParameterCount();
}
}
/// <summary>Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. Defined in the OpCodes enumeration. </param>
/// <param name="arg">The numerical argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001AB7 RID: 6839 RVA: 0x00063F48 File Offset: 0x00062148
public virtual void Emit(OpCode opcode, double arg)
{
byte[] bytes = BitConverter.GetBytes(arg);
this.make_room(10);
this.ll_emit(opcode);
if (BitConverter.IsLittleEndian)
{
Array.Copy(bytes, 0, this.code, this.code_len, 8);
this.code_len += 8;
}
else
{
this.code[this.code_len++] = bytes[7];
this.code[this.code_len++] = bytes[6];
this.code[this.code_len++] = bytes[5];
this.code[this.code_len++] = bytes[4];
this.code[this.code_len++] = bytes[3];
this.code[this.code_len++] = bytes[2];
this.code[this.code_len++] = bytes[1];
this.code[this.code_len++] = bytes[0];
}
}
/// <summary>Puts the specified instruction and metadata token for the specified field onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="field">A FieldInfo representing a field. </param>
// Token: 0x06001AB8 RID: 6840 RVA: 0x00064074 File Offset: 0x00062274
public virtual void Emit(OpCode opcode, FieldInfo field)
{
int token = this.token_gen.GetToken(field);
this.make_room(6);
this.ll_emit(opcode);
if (field.DeclaringType.Module == this.module)
{
this.add_token_fixup(field);
}
this.emit_int(token);
}
/// <summary>Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="arg">The Int argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001AB9 RID: 6841 RVA: 0x000640C0 File Offset: 0x000622C0
public virtual void Emit(OpCode opcode, short arg)
{
this.make_room(4);
this.ll_emit(opcode);
this.code[this.code_len++] = (byte)(arg & 255);
this.code[this.code_len++] = (byte)((arg >> 8) & 255);
}
/// <summary>Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. </param>
/// <param name="arg">The numerical argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001ABA RID: 6842 RVA: 0x00064120 File Offset: 0x00062320
public virtual void Emit(OpCode opcode, int arg)
{
this.make_room(6);
this.ll_emit(opcode);
this.emit_int(arg);
}
/// <summary>Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. </param>
/// <param name="arg">The numerical argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001ABB RID: 6843 RVA: 0x00064144 File Offset: 0x00062344
public virtual void Emit(OpCode opcode, long arg)
{
this.make_room(10);
this.ll_emit(opcode);
this.code[this.code_len++] = (byte)(arg & 255L);
this.code[this.code_len++] = (byte)((arg >> 8) & 255L);
this.code[this.code_len++] = (byte)((arg >> 16) & 255L);
this.code[this.code_len++] = (byte)((arg >> 24) & 255L);
this.code[this.code_len++] = (byte)((arg >> 32) & 255L);
this.code[this.code_len++] = (byte)((arg >> 40) & 255L);
this.code[this.code_len++] = (byte)((arg >> 48) & 255L);
this.code[this.code_len++] = (byte)((arg >> 56) & 255L);
}
/// <summary>Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="label">The label to which to branch from this location. </param>
// Token: 0x06001ABC RID: 6844 RVA: 0x0006427C File Offset: 0x0006247C
public virtual void Emit(OpCode opcode, Label label)
{
int num = ILGenerator.target_len(opcode);
this.make_room(6);
this.ll_emit(opcode);
if (this.cur_stack > this.labels[label.label].maxStack)
{
this.labels[label.label].maxStack = this.cur_stack;
}
if (this.fixups == null)
{
this.fixups = new ILGenerator.LabelFixup[4];
}
else if (this.num_fixups >= this.fixups.Length)
{
ILGenerator.LabelFixup[] array = new ILGenerator.LabelFixup[this.fixups.Length * 2];
Array.Copy(this.fixups, array, this.fixups.Length);
this.fixups = array;
}
this.fixups[this.num_fixups].offset = num;
this.fixups[this.num_fixups].pos = this.code_len;
this.fixups[this.num_fixups].label_idx = label.label;
this.num_fixups++;
this.code_len += num;
}
/// <summary>Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream and leaves space to include a label when fixes are done.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="labels">The array of label objects to which to branch from this location. All of the labels will be used. </param>
// Token: 0x06001ABD RID: 6845 RVA: 0x000643A4 File Offset: 0x000625A4
public virtual void Emit(OpCode opcode, Label[] labels)
{
if (labels == null)
{
throw new ArgumentNullException("labels");
}
int num = labels.Length;
this.make_room(6 + num * 4);
this.ll_emit(opcode);
for (int i = 0; i < num; i++)
{
if (this.cur_stack > this.labels[labels[i].label].maxStack)
{
this.labels[labels[i].label].maxStack = this.cur_stack;
}
}
this.emit_int(num);
if (this.fixups == null)
{
this.fixups = new ILGenerator.LabelFixup[4 + num];
}
else if (this.num_fixups + num >= this.fixups.Length)
{
ILGenerator.LabelFixup[] array = new ILGenerator.LabelFixup[num + this.fixups.Length * 2];
Array.Copy(this.fixups, array, this.fixups.Length);
this.fixups = array;
}
int j = 0;
int num2 = num * 4;
while (j < num)
{
this.fixups[this.num_fixups].offset = num2;
this.fixups[this.num_fixups].pos = this.code_len;
this.fixups[this.num_fixups].label_idx = labels[j].label;
this.num_fixups++;
this.code_len += 4;
j++;
num2 -= 4;
}
}
/// <summary>Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the index of the given local variable.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="local">A local variable. </param>
/// <exception cref="T:System.ArgumentException">The parent method of the <paramref name="local" /> parameter does not match the method associated with this <see cref="T:System.Reflection.Emit.ILGenerator" />. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="local" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="opcode" /> is a single-byte instruction, and <paramref name="local" /> represents a local variable with an index greater than Byte.MaxValue. </exception>
// Token: 0x06001ABE RID: 6846 RVA: 0x0006452C File Offset: 0x0006272C
public virtual void Emit(OpCode opcode, LocalBuilder local)
{
if (local == null)
{
throw new ArgumentNullException("local");
}
uint position = (uint)local.position;
bool flag = false;
bool flag2 = false;
this.make_room(6);
if (local.ilgen != this)
{
throw new ArgumentException("Trying to emit a local from a different ILGenerator.");
}
if (opcode.StackBehaviourPop == StackBehaviour.Pop1)
{
this.cur_stack--;
flag2 = true;
}
else
{
this.cur_stack++;
if (this.cur_stack > this.max_stack)
{
this.max_stack = this.cur_stack;
}
flag = opcode.StackBehaviourPush == StackBehaviour.Pushi;
}
if (flag)
{
if (position < 256U)
{
this.code[this.code_len++] = 18;
this.code[this.code_len++] = (byte)position;
}
else
{
this.code[this.code_len++] = 254;
this.code[this.code_len++] = 13;
this.code[this.code_len++] = (byte)(position & 255U);
this.code[this.code_len++] = (byte)((position >> 8) & 255U);
}
}
else if (flag2)
{
if (position < 4U)
{
this.code[this.code_len++] = (byte)(10U + position);
}
else if (position < 256U)
{
this.code[this.code_len++] = 19;
this.code[this.code_len++] = (byte)position;
}
else
{
this.code[this.code_len++] = 254;
this.code[this.code_len++] = 14;
this.code[this.code_len++] = (byte)(position & 255U);
this.code[this.code_len++] = (byte)((position >> 8) & 255U);
}
}
else if (position < 4U)
{
this.code[this.code_len++] = (byte)(6U + position);
}
else if (position < 256U)
{
this.code[this.code_len++] = 17;
this.code[this.code_len++] = (byte)position;
}
else
{
this.code[this.code_len++] = 254;
this.code[this.code_len++] = 12;
this.code[this.code_len++] = (byte)(position & 255U);
this.code[this.code_len++] = (byte)((position >> 8) & 255U);
}
}
/// <summary>Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given method.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="meth">A MethodInfo representing a method. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="meth" /> is null. </exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="meth" /> is a generic method for which the <see cref="P:System.Reflection.MethodInfo.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001ABF RID: 6847 RVA: 0x0006486C File Offset: 0x00062A6C
public virtual void Emit(OpCode opcode, MethodInfo meth)
{
if (meth == null)
{
throw new ArgumentNullException("meth");
}
if (meth is DynamicMethod && (opcode == OpCodes.Ldftn || opcode == OpCodes.Ldvirtftn || opcode == OpCodes.Ldtoken))
{
throw new ArgumentException("Ldtoken, Ldftn and Ldvirtftn OpCodes cannot target DynamicMethods.");
}
int token = this.token_gen.GetToken(meth);
this.make_room(6);
this.ll_emit(opcode);
Type declaringType = meth.DeclaringType;
if (declaringType != null && declaringType.Module == this.module)
{
this.add_token_fixup(meth);
}
this.emit_int(token);
if (meth.ReturnType != ILGenerator.void_type)
{
this.cur_stack++;
}
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
{
this.cur_stack -= meth.GetParameterCount();
}
}
// Token: 0x06001AC0 RID: 6848 RVA: 0x00064958 File Offset: 0x00062B58
private void Emit(OpCode opcode, MethodInfo method, int token)
{
this.make_room(6);
this.ll_emit(opcode);
Type declaringType = method.DeclaringType;
if (declaringType != null && declaringType.Module == this.module)
{
this.add_token_fixup(method);
}
this.emit_int(token);
if (method.ReturnType != ILGenerator.void_type)
{
this.cur_stack++;
}
if (opcode.StackBehaviourPop == StackBehaviour.Varpop)
{
this.cur_stack -= method.GetParameterCount();
}
}
/// <summary>Puts the specified instruction and character argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. </param>
/// <param name="arg">The character argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001AC1 RID: 6849 RVA: 0x000649E0 File Offset: 0x00062BE0
[CLSCompliant(false)]
public void Emit(OpCode opcode, sbyte arg)
{
this.make_room(3);
this.ll_emit(opcode);
this.code[this.code_len++] = (byte)arg;
}
/// <summary>Puts the specified instruction and a signature token onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="signature">A helper for constructing a signature token. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="signature" /> is null. </exception>
// Token: 0x06001AC2 RID: 6850 RVA: 0x00064A18 File Offset: 0x00062C18
public virtual void Emit(OpCode opcode, SignatureHelper signature)
{
int token = this.token_gen.GetToken(signature);
this.make_room(6);
this.ll_emit(opcode);
this.emit_int(token);
}
/// <summary>Puts the specified instruction and numerical argument onto the Microsoft intermediate language (MSIL) stream of instructions.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. </param>
/// <param name="arg">The Single argument pushed onto the stream immediately after the instruction. </param>
// Token: 0x06001AC3 RID: 6851 RVA: 0x00064A48 File Offset: 0x00062C48
public virtual void Emit(OpCode opcode, float arg)
{
byte[] bytes = BitConverter.GetBytes(arg);
this.make_room(6);
this.ll_emit(opcode);
if (BitConverter.IsLittleEndian)
{
Array.Copy(bytes, 0, this.code, this.code_len, 4);
this.code_len += 4;
}
else
{
this.code[this.code_len++] = bytes[3];
this.code[this.code_len++] = bytes[2];
this.code[this.code_len++] = bytes[1];
this.code[this.code_len++] = bytes[0];
}
}
/// <summary>Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given string.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. </param>
/// <param name="str">The String to be emitted. </param>
// Token: 0x06001AC4 RID: 6852 RVA: 0x00064B08 File Offset: 0x00062D08
public virtual void Emit(OpCode opcode, string str)
{
int token = this.token_gen.GetToken(str);
this.make_room(6);
this.ll_emit(opcode);
this.emit_int(token);
}
/// <summary>Puts the specified instruction onto the Microsoft intermediate language (MSIL) stream followed by the metadata token for the given type.</summary>
/// <param name="opcode">The MSIL instruction to be put onto the stream. </param>
/// <param name="cls">A Type. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="cls" /> is null. </exception>
// Token: 0x06001AC5 RID: 6853 RVA: 0x00064B38 File Offset: 0x00062D38
public virtual void Emit(OpCode opcode, Type cls)
{
this.make_room(6);
this.ll_emit(opcode);
this.emit_int(this.token_gen.GetToken(cls));
}
/// <summary>Puts a call or callvirt instruction onto the Microsoft intermediate language (MSIL) stream to call a varargs method.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. Must be <see cref="F:System.Reflection.Emit.OpCodes.Call" />, <see cref="F:System.Reflection.Emit.OpCodes.Callvirt" />, or <see cref="F:System.Reflection.Emit.OpCodes.Newobj" />.</param>
/// <param name="methodInfo">The varargs method to be called. </param>
/// <param name="optionalParameterTypes">The types of the optional arguments if the method is a varargs method; otherwise, null. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="methodInfo" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The calling convention for the method is not varargs, but optional parameter types are supplied. This exception is thrown in the .NET Framework versions 1.0 and 1.1, In subsequent versions, no exception is thrown.</exception>
// Token: 0x06001AC6 RID: 6854 RVA: 0x00064B68 File Offset: 0x00062D68
[MonoLimitation("vararg methods are not supported")]
public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)
{
if (methodInfo == null)
{
throw new ArgumentNullException("methodInfo");
}
short value = opcode.Value;
if (value != OpCodes.Call.Value && value != OpCodes.Callvirt.Value)
{
throw new NotSupportedException("Only Call and CallVirt are allowed");
}
if ((methodInfo.CallingConvention & CallingConventions.VarArgs) == (CallingConventions)0)
{
optionalParameterTypes = null;
}
if (optionalParameterTypes == null)
{
this.Emit(opcode, methodInfo);
return;
}
if ((methodInfo.CallingConvention & CallingConventions.VarArgs) == (CallingConventions)0)
{
throw new InvalidOperationException("Method is not VarArgs method and optional types were passed");
}
int token = this.token_gen.GetToken(methodInfo, optionalParameterTypes);
this.Emit(opcode, methodInfo, token);
}
/// <summary>Puts a <see cref="F:System.Reflection.Emit.OpCodes.Calli" /> instruction onto the Microsoft intermediate language (MSIL) stream, specifying an unmanaged calling convention for the indirect call.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. Must be <see cref="F:System.Reflection.Emit.OpCodes.Calli" />.</param>
/// <param name="unmanagedCallConv">The unmanaged calling convention to be used. </param>
/// <param name="returnType">The <see cref="T:System.Type" /> of the result. </param>
/// <param name="parameterTypes">The types of the required arguments to the instruction. </param>
// Token: 0x06001AC7 RID: 6855 RVA: 0x00064C10 File Offset: 0x00062E10
public virtual void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type returnType, Type[] parameterTypes)
{
SignatureHelper methodSigHelper = SignatureHelper.GetMethodSigHelper(this.module, (CallingConventions)0, unmanagedCallConv, returnType, parameterTypes);
this.Emit(opcode, methodSigHelper);
}
/// <summary>Puts a <see cref="F:System.Reflection.Emit.OpCodes.Calli" /> instruction onto the Microsoft intermediate language (MSIL) stream, specifying a managed calling convention for the indirect call.</summary>
/// <param name="opcode">The MSIL instruction to be emitted onto the stream. Must be <see cref="F:System.Reflection.Emit.OpCodes.Calli" />. </param>
/// <param name="callingConvention">The managed calling convention to be used. </param>
/// <param name="returnType">The <see cref="T:System.Type" /> of the result. </param>
/// <param name="parameterTypes">The types of the required arguments to the instruction. </param>
/// <param name="optionalParameterTypes">The types of the optional arguments for varargs calls. </param>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="optionalParameterTypes" /> is not null, but <paramref name="callingConvention" /> does not include the <see cref="F:System.Reflection.CallingConventions.VarArgs" /> flag.</exception>
// Token: 0x06001AC8 RID: 6856 RVA: 0x00064C38 File Offset: 0x00062E38
public virtual void EmitCalli(OpCode opcode, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type[] optionalParameterTypes)
{
if (optionalParameterTypes != null)
{
throw new NotImplementedException();
}
SignatureHelper methodSigHelper = SignatureHelper.GetMethodSigHelper(this.module, callingConvention, (CallingConvention)0, returnType, parameterTypes);
this.Emit(opcode, methodSigHelper);
}
/// <summary>Emits the Microsoft intermediate language (MSIL) necessary to call <see cref="Overload:System.Console.WriteLine" /> with the given field.</summary>
/// <param name="fld">The field whose value is to be written to the console. </param>
/// <exception cref="T:System.ArgumentException">There is no overload of the <see cref="Overload:System.Console.WriteLine" /> method that accepts the type of the specified field. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="fld" /> is null. </exception>
/// <exception cref="T:System.NotSupportedException">The type of the field is <see cref="T:System.Reflection.Emit.TypeBuilder" /> or <see cref="T:System.Reflection.Emit.EnumBuilder" />, which are not supported. </exception>
// Token: 0x06001AC9 RID: 6857 RVA: 0x00064C6C File Offset: 0x00062E6C
public virtual void EmitWriteLine(FieldInfo fld)
{
if (fld == null)
{
throw new ArgumentNullException("fld");
}
if (fld.IsStatic)
{
this.Emit(OpCodes.Ldsfld, fld);
}
else
{
this.Emit(OpCodes.Ldarg_0);
this.Emit(OpCodes.Ldfld, fld);
}
this.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine", new Type[] { fld.FieldType }));
}
/// <summary>Emits the Microsoft intermediate language (MSIL) necessary to call <see cref="Overload:System.Console.WriteLine" /> with the given local variable.</summary>
/// <param name="localBuilder">The local variable whose value is to be written to the console. </param>
/// <exception cref="T:System.ArgumentException">The type of <paramref name="localBuilder" /> is <see cref="T:System.Reflection.Emit.TypeBuilder" /> or <see cref="T:System.Reflection.Emit.EnumBuilder" />, which are not supported. -or-There is no overload of <see cref="Overload:System.Console.WriteLine" /> that accepts the type of <paramref name="localBuilder" />. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="localBuilder" /> is null. </exception>
// Token: 0x06001ACA RID: 6858 RVA: 0x00064CEC File Offset: 0x00062EEC
public virtual void EmitWriteLine(LocalBuilder localBuilder)
{
if (localBuilder == null)
{
throw new ArgumentNullException("localBuilder");
}
if (localBuilder.LocalType is TypeBuilder)
{
throw new ArgumentException("Output streams do not support TypeBuilders.");
}
this.Emit(OpCodes.Ldloc, localBuilder);
this.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine", new Type[] { localBuilder.LocalType }));
}
/// <summary>Emits the Microsoft intermediate language (MSIL) to call <see cref="Overload:System.Console.WriteLine" /> with a string.</summary>
/// <param name="value">The string to be printed. </param>
// Token: 0x06001ACB RID: 6859 RVA: 0x00064D60 File Offset: 0x00062F60
public virtual void EmitWriteLine(string value)
{
this.Emit(OpCodes.Ldstr, value);
this.Emit(OpCodes.Call, typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) }));
}
/// <summary>Ends an exception block.</summary>
/// <exception cref="T:System.InvalidOperationException">The end exception block occurs in an unexpected place in the code stream. </exception>
/// <exception cref="T:System.NotSupportedException">The Microsoft intermediate language (MSIL) being generated is not currently in an exception block. </exception>
// Token: 0x06001ACC RID: 6860 RVA: 0x00064DAC File Offset: 0x00062FAC
public virtual void EndExceptionBlock()
{
if (this.open_blocks == null)
{
this.open_blocks = new Stack(2);
}
if (this.open_blocks.Count <= 0)
{
throw new NotSupportedException("Not in an exception block");
}
if (this.ex_handlers[this.cur_block].LastClauseType() == -1)
{
throw new InvalidOperationException("Incorrect code generation for exception block.");
}
this.InternalEndClause();
this.MarkLabel(this.ex_handlers[this.cur_block].end);
this.ex_handlers[this.cur_block].End(this.code_len);
this.ex_handlers[this.cur_block].Debug(this.cur_block);
this.open_blocks.Pop();
if (this.open_blocks.Count > 0)
{
this.cur_block = (int)this.open_blocks.Peek();
}
}
/// <summary>Ends a lexical scope.</summary>
/// <exception cref="T:System.NotSupportedException">This <see cref="T:System.Reflection.Emit.ILGenerator" /> belongs to a <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06001ACD RID: 6861 RVA: 0x00064EA0 File Offset: 0x000630A0
public virtual void EndScope()
{
}
/// <summary>Marks the Microsoft intermediate language (MSIL) stream's current position with the given label.</summary>
/// <param name="loc">The label for which to set an index. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="loc" /> represents an invalid index into the label array.-or- An index for <paramref name="loc" /> has already been defined. </exception>
// Token: 0x06001ACE RID: 6862 RVA: 0x00064EA4 File Offset: 0x000630A4
public virtual void MarkLabel(Label loc)
{
if (loc.label < 0 || loc.label >= this.num_labels)
{
throw new ArgumentException("The label is not valid");
}
if (this.labels[loc.label].addr >= 0)
{
throw new ArgumentException("The label was already defined");
}
this.labels[loc.label].addr = this.code_len;
if (this.labels[loc.label].maxStack > this.cur_stack)
{
this.cur_stack = this.labels[loc.label].maxStack;
}
}
/// <summary>Marks a sequence point in the Microsoft intermediate language (MSIL) stream.</summary>
/// <param name="document">The document for which the sequence point is being defined. </param>
/// <param name="startLine">The line where the sequence point begins. </param>
/// <param name="startColumn">The column in the line where the sequence point begins. </param>
/// <param name="endLine">The line where the sequence point ends. </param>
/// <param name="endColumn">The column in the line where the sequence point ends. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="startLine" /> or <paramref name="endLine" /> is &lt;= 0. </exception>
/// <exception cref="T:System.NotSupportedException">This <see cref="T:System.Reflection.Emit.ILGenerator" /> belongs to a <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06001ACF RID: 6863 RVA: 0x00064F60 File Offset: 0x00063160
public virtual void MarkSequencePoint(ISymbolDocumentWriter document, int startLine, int startColumn, int endLine, int endColumn)
{
if (this.currentSequence == null || this.currentSequence.Document != document)
{
if (this.sequencePointLists == null)
{
this.sequencePointLists = new ArrayList();
}
this.currentSequence = new SequencePointList(document);
this.sequencePointLists.Add(this.currentSequence);
}
this.currentSequence.AddSequencePoint(this.code_len, startLine, startColumn, endLine, endColumn);
}
// Token: 0x06001AD0 RID: 6864 RVA: 0x00064FD4 File Offset: 0x000631D4
internal void GenerateDebugInfo(ISymbolWriter symbolWriter)
{
if (this.sequencePointLists != null)
{
SequencePointList sequencePointList = (SequencePointList)this.sequencePointLists[0];
SequencePointList sequencePointList2 = (SequencePointList)this.sequencePointLists[this.sequencePointLists.Count - 1];
symbolWriter.SetMethodSourceRange(sequencePointList.Document, sequencePointList.StartLine, sequencePointList.StartColumn, sequencePointList2.Document, sequencePointList2.EndLine, sequencePointList2.EndColumn);
foreach (object obj in this.sequencePointLists)
{
SequencePointList sequencePointList3 = (SequencePointList)obj;
symbolWriter.DefineSequencePoints(sequencePointList3.Document, sequencePointList3.GetOffsets(), sequencePointList3.GetLines(), sequencePointList3.GetColumns(), sequencePointList3.GetEndLines(), sequencePointList3.GetEndColumns());
}
if (this.locals != null)
{
foreach (LocalBuilder localBuilder in this.locals)
{
if (localBuilder.Name != null && localBuilder.Name.Length > 0)
{
SignatureHelper localVarSigHelper = SignatureHelper.GetLocalVarSigHelper(this.module);
localVarSigHelper.AddArgument(localBuilder.LocalType);
byte[] signature = localVarSigHelper.GetSignature();
symbolWriter.DefineLocalVariable(localBuilder.Name, FieldAttributes.Public, signature, SymAddressKind.ILOffset, (int)localBuilder.position, 0, 0, localBuilder.StartOffset, localBuilder.EndOffset);
}
}
}
this.sequencePointLists = null;
}
}
// Token: 0x170004BD RID: 1213
// (get) Token: 0x06001AD1 RID: 6865 RVA: 0x00065174 File Offset: 0x00063374
internal bool HasDebugInfo
{
get
{
return this.sequencePointLists != null;
}
}
/// <summary>Emits an instruction to throw an exception.</summary>
/// <param name="excType">The class of the type of exception to throw. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="excType" /> is not the <see cref="T:System.Exception" /> class or a derived class of <see cref="T:System.Exception" />.-or- The type does not have a default constructor. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="excType" /> is null. </exception>
// Token: 0x06001AD2 RID: 6866 RVA: 0x00065184 File Offset: 0x00063384
public virtual void ThrowException(Type excType)
{
if (excType == null)
{
throw new ArgumentNullException("excType");
}
if (excType != typeof(Exception) && !excType.IsSubclassOf(typeof(Exception)))
{
throw new ArgumentException("Type should be an exception type", "excType");
}
ConstructorInfo constructor = excType.GetConstructor(Type.EmptyTypes);
if (constructor == null)
{
throw new ArgumentException("Type should have a default constructor", "excType");
}
this.Emit(OpCodes.Newobj, constructor);
this.Emit(OpCodes.Throw);
}
/// <summary>Specifies the namespace to be used in evaluating locals and watches for the current active lexical scope.</summary>
/// <param name="usingNamespace">The namespace to be used in evaluating locals and watches for the current active lexical scope </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="usingNamespace" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="usingNamespace" /> is null. </exception>
/// <exception cref="T:System.NotSupportedException">This <see cref="T:System.Reflection.Emit.ILGenerator" /> belongs to a <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06001AD3 RID: 6867 RVA: 0x00065210 File Offset: 0x00063410
[MonoTODO("Not implemented")]
public virtual void UsingNamespace(string usingNamespace)
{
throw new NotImplementedException();
}
// Token: 0x06001AD4 RID: 6868 RVA: 0x00065218 File Offset: 0x00063418
internal void label_fixup()
{
for (int i = 0; i < this.num_fixups; i++)
{
if (this.labels[this.fixups[i].label_idx].addr < 0)
{
throw new ArgumentException("Label not marked");
}
int num = this.labels[this.fixups[i].label_idx].addr - (this.fixups[i].pos + this.fixups[i].offset);
if (this.fixups[i].offset == 1)
{
this.code[this.fixups[i].pos] = (byte)((sbyte)num);
}
else
{
int num2 = this.code_len;
this.code_len = this.fixups[i].pos;
this.emit_int(num);
this.code_len = num2;
}
}
}
// Token: 0x06001AD5 RID: 6869 RVA: 0x00065318 File Offset: 0x00063518
[Obsolete("Use ILOffset")]
internal static int Mono_GetCurrentOffset(ILGenerator ig)
{
return ig.code_len;
}
// Token: 0x040007E5 RID: 2021
private const int defaultFixupSize = 4;
// Token: 0x040007E6 RID: 2022
private const int defaultLabelsSize = 4;
// Token: 0x040007E7 RID: 2023
private const int defaultExceptionStackSize = 2;
// Token: 0x040007E8 RID: 2024
private static readonly Type void_type = typeof(void);
// Token: 0x040007E9 RID: 2025
private byte[] code;
// Token: 0x040007EA RID: 2026
private int code_len;
// Token: 0x040007EB RID: 2027
private int max_stack;
// Token: 0x040007EC RID: 2028
private int cur_stack;
// Token: 0x040007ED RID: 2029
private LocalBuilder[] locals;
// Token: 0x040007EE RID: 2030
private ILExceptionInfo[] ex_handlers;
// Token: 0x040007EF RID: 2031
private int num_token_fixups;
// Token: 0x040007F0 RID: 2032
private ILTokenInfo[] token_fixups;
// Token: 0x040007F1 RID: 2033
private ILGenerator.LabelData[] labels;
// Token: 0x040007F2 RID: 2034
private int num_labels;
// Token: 0x040007F3 RID: 2035
private ILGenerator.LabelFixup[] fixups;
// Token: 0x040007F4 RID: 2036
private int num_fixups;
// Token: 0x040007F5 RID: 2037
internal Module module;
// Token: 0x040007F6 RID: 2038
private int cur_block;
// Token: 0x040007F7 RID: 2039
private Stack open_blocks;
// Token: 0x040007F8 RID: 2040
private TokenGenerator token_gen;
// Token: 0x040007F9 RID: 2041
private ArrayList sequencePointLists;
// Token: 0x040007FA RID: 2042
private SequencePointList currentSequence;
// Token: 0x020001FD RID: 509
private struct LabelFixup
{
// Token: 0x040007FB RID: 2043
public int offset;
// Token: 0x040007FC RID: 2044
public int pos;
// Token: 0x040007FD RID: 2045
public int label_idx;
}
// Token: 0x020001FE RID: 510
private struct LabelData
{
// Token: 0x06001AD6 RID: 6870 RVA: 0x00065320 File Offset: 0x00063520
public LabelData(int addr, int maxStack)
{
this.addr = addr;
this.maxStack = maxStack;
}
// Token: 0x040007FE RID: 2046
public int addr;
// Token: 0x040007FF RID: 2047
public int maxStack;
}
}
}
@@ -0,0 +1,14 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001FA RID: 506
internal struct ILTokenInfo
{
// Token: 0x040007E3 RID: 2019
public MemberInfo member;
// Token: 0x040007E4 RID: 2020
public int code_pos;
}
}
+73
View File
@@ -0,0 +1,73 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents a label in the instruction stream. Label is used in conjunction with the <see cref="T:System.Reflection.Emit.ILGenerator" /> class.</summary>
// Token: 0x02000201 RID: 513
[ComVisible(true)]
[Serializable]
public struct Label
{
// Token: 0x06001AE3 RID: 6883 RVA: 0x000655D0 File Offset: 0x000637D0
internal Label(int val)
{
this.label = val;
}
/// <summary>Checks if the given object is an instance of Label and is equal to this instance.</summary>
/// <returns>Returns true if <paramref name="obj" /> is an instance of Label and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare with this Label instance. </param>
// Token: 0x06001AE4 RID: 6884 RVA: 0x000655DC File Offset: 0x000637DC
public override bool Equals(object obj)
{
bool flag = obj is Label;
if (flag)
{
Label label = (Label)obj;
flag = this.label == label.label;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.Label" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.Label" /> to compare to the current instance.</param>
// Token: 0x06001AE5 RID: 6885 RVA: 0x00065614 File Offset: 0x00063814
public bool Equals(Label obj)
{
return this.label == obj.label;
}
/// <summary>Generates a hash code for this instance.</summary>
/// <returns>Returns a hash code for this instance.</returns>
// Token: 0x06001AE6 RID: 6886 RVA: 0x00065628 File Offset: 0x00063828
public override int GetHashCode()
{
return this.label.GetHashCode();
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.Label" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.Label" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.Label" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001AE7 RID: 6887 RVA: 0x00065638 File Offset: 0x00063838
public static bool operator ==(Label a, Label b)
{
return a.Equals(b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.Label" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.Label" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.Label" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001AE8 RID: 6888 RVA: 0x00065644 File Offset: 0x00063844
public static bool operator !=(Label a, Label b)
{
return !(a == b);
}
// Token: 0x04000809 RID: 2057
internal int label;
}
}
@@ -0,0 +1,177 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents a local variable within a method or constructor.</summary>
// Token: 0x02000202 RID: 514
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_LocalBuilder))]
public sealed class LocalBuilder : LocalVariableInfo, _LocalBuilder
{
// Token: 0x06001AE9 RID: 6889 RVA: 0x00065650 File Offset: 0x00063850
internal LocalBuilder(Type t, ILGenerator ilgen)
{
this.type = t;
this.ilgen = ilgen;
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AEA RID: 6890 RVA: 0x00065668 File Offset: 0x00063868
void _LocalBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AEB RID: 6891 RVA: 0x00065670 File Offset: 0x00063870
void _LocalBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AEC RID: 6892 RVA: 0x00065678 File Offset: 0x00063878
void _LocalBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AED RID: 6893 RVA: 0x00065680 File Offset: 0x00063880
void _LocalBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Sets the name and lexical scope of this local variable.</summary>
/// <param name="name">The name of the local variable. </param>
/// <param name="startOffset">The beginning offset of the lexical scope of the local variable. </param>
/// <param name="endOffset">The ending offset of the lexical scope of the local variable. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created with <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- There is no symbolic writer defined for the containing module. </exception>
/// <exception cref="T:System.NotSupportedException">This local is defined in a dynamic method, rather than in a method of a dynamic type.</exception>
// Token: 0x06001AEE RID: 6894 RVA: 0x00065688 File Offset: 0x00063888
public void SetLocalSymInfo(string name, int startOffset, int endOffset)
{
this.name = name;
this.startOffset = startOffset;
this.endOffset = endOffset;
}
/// <summary>Sets the name of this local variable.</summary>
/// <param name="name">The name of the local variable. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created with <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- There is no symbolic writer defined for the containing module. </exception>
/// <exception cref="T:System.NotSupportedException">This local is defined in a dynamic method, rather than in a method of a dynamic type.</exception>
// Token: 0x06001AEF RID: 6895 RVA: 0x000656A0 File Offset: 0x000638A0
public void SetLocalSymInfo(string name)
{
this.SetLocalSymInfo(name, 0, 0);
}
/// <summary>Gets the type of the local variable.</summary>
/// <returns>The <see cref="T:System.Type" /> of the local variable.</returns>
// Token: 0x170004C3 RID: 1219
// (get) Token: 0x06001AF0 RID: 6896 RVA: 0x000656AC File Offset: 0x000638AC
public override Type LocalType
{
get
{
return this.type;
}
}
/// <summary>Gets a value indicating whether the object referred to by the local variable is pinned in memory.</summary>
/// <returns>true if the object referred to by the local variable is pinned in memory; otherwise, false.</returns>
// Token: 0x170004C4 RID: 1220
// (get) Token: 0x06001AF1 RID: 6897 RVA: 0x000656B4 File Offset: 0x000638B4
public override bool IsPinned
{
get
{
return this.is_pinned;
}
}
/// <summary>Gets the zero-based index of the local variable within the method body.</summary>
/// <returns>An integer value that represents the order of declaration of the local variable within the method body.</returns>
// Token: 0x170004C5 RID: 1221
// (get) Token: 0x06001AF2 RID: 6898 RVA: 0x000656BC File Offset: 0x000638BC
public override int LocalIndex
{
get
{
return (int)this.position;
}
}
// Token: 0x06001AF3 RID: 6899 RVA: 0x000656C4 File Offset: 0x000638C4
internal static int Mono_GetLocalIndex(LocalBuilder builder)
{
return (int)builder.position;
}
// Token: 0x170004C6 RID: 1222
// (get) Token: 0x06001AF4 RID: 6900 RVA: 0x000656CC File Offset: 0x000638CC
internal string Name
{
get
{
return this.name;
}
}
// Token: 0x170004C7 RID: 1223
// (get) Token: 0x06001AF5 RID: 6901 RVA: 0x000656D4 File Offset: 0x000638D4
internal int StartOffset
{
get
{
return this.startOffset;
}
}
// Token: 0x170004C8 RID: 1224
// (get) Token: 0x06001AF6 RID: 6902 RVA: 0x000656DC File Offset: 0x000638DC
internal int EndOffset
{
get
{
return this.endOffset;
}
}
// Token: 0x0400080A RID: 2058
private string name;
// Token: 0x0400080B RID: 2059
internal ILGenerator ilgen;
// Token: 0x0400080C RID: 2060
private int startOffset;
// Token: 0x0400080D RID: 2061
private int endOffset;
}
}
@@ -0,0 +1,994 @@
using System;
using System.Diagnostics.SymbolStore;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
namespace System.Reflection.Emit
{
/// <summary>Defines and represents a method (or constructor) on a dynamic class.</summary>
// Token: 0x02000203 RID: 515
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_MethodBuilder))]
public sealed class MethodBuilder : MethodInfo, _MethodBuilder
{
// Token: 0x06001AF7 RID: 6903 RVA: 0x000656E4 File Offset: 0x000638E4
internal MethodBuilder(TypeBuilder tb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt)
{
this.name = name;
this.attrs = attributes;
this.call_conv = callingConvention;
this.rtype = returnType;
this.returnModReq = returnModReq;
this.returnModOpt = returnModOpt;
this.paramModReq = paramModReq;
this.paramModOpt = paramModOpt;
if ((attributes & MethodAttributes.Static) == MethodAttributes.PrivateScope)
{
this.call_conv |= CallingConventions.HasThis;
}
if (parameterTypes != null)
{
for (int i = 0; i < parameterTypes.Length; i++)
{
if (parameterTypes[i] == null)
{
throw new ArgumentException("Elements of the parameterTypes array cannot be null", "parameterTypes");
}
}
this.parameters = new Type[parameterTypes.Length];
Array.Copy(parameterTypes, this.parameters, parameterTypes.Length);
}
this.type = tb;
this.table_idx = this.get_next_table_index(this, 6, true);
((ModuleBuilder)tb.Module).RegisterToken(this, this.GetToken().Token);
}
// Token: 0x06001AF8 RID: 6904 RVA: 0x000657E0 File Offset: 0x000639E0
internal MethodBuilder(TypeBuilder tb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt, string dllName, string entryName, CallingConvention nativeCConv, CharSet nativeCharset)
: this(tb, name, attributes, callingConvention, returnType, returnModReq, returnModOpt, parameterTypes, paramModReq, paramModOpt)
{
this.pi_dll = dllName;
this.pi_entry = entryName;
this.native_cc = nativeCConv;
this.charset = nativeCharset;
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array that receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AF9 RID: 6905 RVA: 0x00065824 File Offset: 0x00063A24
void _MethodBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AFA RID: 6906 RVA: 0x0006582C File Offset: 0x00063A2C
void _MethodBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AFB RID: 6907 RVA: 0x00065834 File Offset: 0x00063A34
void _MethodBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DispIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001AFC RID: 6908 RVA: 0x0006583C File Offset: 0x00063A3C
void _MethodBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Not supported for this type.</summary>
/// <returns>Not supported.</returns>
/// <exception cref="T:System.NotSupportedException">The invoked method is not supported in the base class.</exception>
// Token: 0x170004C9 RID: 1225
// (get) Token: 0x06001AFD RID: 6909 RVA: 0x00065844 File Offset: 0x00063A44
public override bool ContainsGenericParameters
{
get
{
throw new NotSupportedException();
}
}
/// <summary>Gets or sets a Boolean value that specifies whether the local variables in this method are zero initialized. The default value of this property is true.</summary>
/// <returns>true if the local variables in this method should be zero initialized; otherwise false.</returns>
/// <exception cref="T:System.InvalidOperationException">For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. (Get or set.)</exception>
// Token: 0x170004CA RID: 1226
// (get) Token: 0x06001AFE RID: 6910 RVA: 0x0006584C File Offset: 0x00063A4C
// (set) Token: 0x06001AFF RID: 6911 RVA: 0x00065854 File Offset: 0x00063A54
public bool InitLocals
{
get
{
return this.init_locals;
}
set
{
this.init_locals = value;
}
}
// Token: 0x170004CB RID: 1227
// (get) Token: 0x06001B00 RID: 6912 RVA: 0x00065860 File Offset: 0x00063A60
internal TypeBuilder TypeBuilder
{
get
{
return this.type;
}
}
/// <summary>Retrieves the internal handle for the method. Use this handle to access the underlying metadata handle.</summary>
/// <returns>Read-only. The internal handle for the method. Use this handle to access the underlying metadata handle.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the method using <see cref="M:System.Type.GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="P:System.Reflection.MethodBase.MethodHandle" /> on the returned <see cref="T:System.Reflection.MethodInfo" />. </exception>
// Token: 0x170004CC RID: 1228
// (get) Token: 0x06001B01 RID: 6913 RVA: 0x00065868 File Offset: 0x00063A68
public override RuntimeMethodHandle MethodHandle
{
get
{
throw this.NotSupported();
}
}
/// <summary>Gets the return type of the method represented by this <see cref="T:System.Reflection.Emit.MethodBuilder" />.</summary>
/// <returns>The return type of the method.</returns>
// Token: 0x170004CD RID: 1229
// (get) Token: 0x06001B02 RID: 6914 RVA: 0x00065870 File Offset: 0x00063A70
public override Type ReturnType
{
get
{
return this.rtype;
}
}
/// <summary>Retrieves the class that was used in reflection to obtain this object.</summary>
/// <returns>Read-only. The type used to obtain this method.</returns>
// Token: 0x170004CE RID: 1230
// (get) Token: 0x06001B03 RID: 6915 RVA: 0x00065878 File Offset: 0x00063A78
public override Type ReflectedType
{
get
{
return this.type;
}
}
/// <summary>Returns the type that declares this method.</summary>
/// <returns>Read-only. The type that declares this method.</returns>
// Token: 0x170004CF RID: 1231
// (get) Token: 0x06001B04 RID: 6916 RVA: 0x00065880 File Offset: 0x00063A80
public override Type DeclaringType
{
get
{
return this.type;
}
}
/// <summary>Retrieves the name of this method.</summary>
/// <returns>Read-only. Retrieves a string containing the simple name of this method.</returns>
// Token: 0x170004D0 RID: 1232
// (get) Token: 0x06001B05 RID: 6917 RVA: 0x00065888 File Offset: 0x00063A88
public override string Name
{
get
{
return this.name;
}
}
/// <summary>Retrieves the attributes for this method.</summary>
/// <returns>Read-only. Retrieves the MethodAttributes for this method.</returns>
// Token: 0x170004D1 RID: 1233
// (get) Token: 0x06001B06 RID: 6918 RVA: 0x00065890 File Offset: 0x00063A90
public override MethodAttributes Attributes
{
get
{
return this.attrs;
}
}
/// <summary>Returns the custom attributes of the method's return type.</summary>
/// <returns>Read-only. The custom attributes of the method's return type.</returns>
// Token: 0x170004D2 RID: 1234
// (get) Token: 0x06001B07 RID: 6919 RVA: 0x00065898 File Offset: 0x00063A98
public override ICustomAttributeProvider ReturnTypeCustomAttributes
{
get
{
return null;
}
}
/// <summary>Returns the calling convention of the method.</summary>
/// <returns>Read-only. The calling convention of the method.</returns>
// Token: 0x170004D3 RID: 1235
// (get) Token: 0x06001B08 RID: 6920 RVA: 0x0006589C File Offset: 0x00063A9C
public override CallingConventions CallingConvention
{
get
{
return this.call_conv;
}
}
/// <summary>Retrieves the signature of the method.</summary>
/// <returns>Read-only. A String containing the signature of the method reflected by this MethodBase instance.</returns>
// Token: 0x170004D4 RID: 1236
// (get) Token: 0x06001B09 RID: 6921 RVA: 0x000658A4 File Offset: 0x00063AA4
[MonoTODO("Not implemented")]
public string Signature
{
get
{
throw new NotImplementedException();
}
}
// Token: 0x170004D5 RID: 1237
// (set) Token: 0x06001B0A RID: 6922 RVA: 0x000658AC File Offset: 0x00063AAC
internal bool BestFitMapping
{
set
{
this.extra_flags = (uint)(((ulong)this.extra_flags & 18446744073709551567UL) | ((!value) ? 32UL : 16UL));
}
}
// Token: 0x170004D6 RID: 1238
// (set) Token: 0x06001B0B RID: 6923 RVA: 0x000658D4 File Offset: 0x00063AD4
internal bool ThrowOnUnmappableChar
{
set
{
this.extra_flags = (uint)(((ulong)this.extra_flags & 18446744073709539327UL) | ((!value) ? 8192UL : 4096UL));
}
}
// Token: 0x170004D7 RID: 1239
// (set) Token: 0x06001B0C RID: 6924 RVA: 0x00065910 File Offset: 0x00063B10
internal bool ExactSpelling
{
set
{
this.extra_flags = (uint)(((ulong)this.extra_flags & 18446744073709551614UL) | ((!value) ? 0UL : 1UL));
}
}
// Token: 0x170004D8 RID: 1240
// (set) Token: 0x06001B0D RID: 6925 RVA: 0x00065934 File Offset: 0x00063B34
internal bool SetLastError
{
set
{
this.extra_flags = (uint)(((ulong)this.extra_flags & 18446744073709551551UL) | ((!value) ? 0UL : 64UL));
}
}
/// <summary>Returns the MethodToken that represents the token for this method.</summary>
/// <returns>Returns the MethodToken of this method.</returns>
// Token: 0x06001B0E RID: 6926 RVA: 0x00065964 File Offset: 0x00063B64
public MethodToken GetToken()
{
return new MethodToken(100663296 | this.table_idx);
}
/// <summary>Return the base implementation for a method.</summary>
/// <returns>The base implementation of this method.</returns>
// Token: 0x06001B0F RID: 6927 RVA: 0x00065978 File Offset: 0x00063B78
public override MethodInfo GetBaseDefinition()
{
return this;
}
/// <summary>Returns the implementation flags for the method.</summary>
/// <returns>Returns the implementation flags for the method.</returns>
// Token: 0x06001B10 RID: 6928 RVA: 0x0006597C File Offset: 0x00063B7C
public override MethodImplAttributes GetMethodImplementationFlags()
{
return this.iattrs;
}
/// <summary>Returns the parameters of this method.</summary>
/// <returns>An array of ParameterInfo objects that represent the parameters of the method.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the method using <see cref="M:System.Type.GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call GetParameters on the returned <see cref="T:System.Reflection.MethodInfo" />. </exception>
// Token: 0x06001B11 RID: 6929 RVA: 0x00065984 File Offset: 0x00063B84
public override ParameterInfo[] GetParameters()
{
if (!this.type.is_created)
{
throw this.NotSupported();
}
if (this.parameters == null)
{
return null;
}
ParameterInfo[] array = new ParameterInfo[this.parameters.Length];
for (int i = 0; i < this.parameters.Length; i++)
{
array[i] = new ParameterInfo((this.pinfo != null) ? this.pinfo[i + 1] : null, this.parameters[i], this, i + 1);
}
return array;
}
// Token: 0x06001B12 RID: 6930 RVA: 0x00065A0C File Offset: 0x00063C0C
internal override int GetParameterCount()
{
if (this.parameters == null)
{
return 0;
}
return this.parameters.Length;
}
/// <summary>Returns a reference to the module that contains this method.</summary>
/// <returns>Returns a reference to the module that contains this method.</returns>
// Token: 0x06001B13 RID: 6931 RVA: 0x00065A24 File Offset: 0x00063C24
public Module GetModule()
{
return this.type.Module;
}
/// <summary>Creates the body of the method using a supplied byte array of Microsoft intermediate language (MSIL) instructions.</summary>
/// <param name="il">An array containing valid MSIL instructions. If this parameter is null, the method's body is cleared. </param>
/// <param name="count">The number of valid bytes in the MSIL array. This value is ignored if MSIL is null. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="count" /> is not within the range of indexes of the supplied MSIL instruction array and <paramref name="il" /> is not null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- This method was called previously on this MethodBuilder with an <paramref name="il" /> argument that was not null.-or-For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
// Token: 0x06001B14 RID: 6932 RVA: 0x00065A34 File Offset: 0x00063C34
public void CreateMethodBody(byte[] il, int count)
{
if (il != null && (count < 0 || count > il.Length))
{
throw new ArgumentOutOfRangeException("Index was out of range. Must be non-negative and less than the size of the collection.");
}
if (this.code != null || this.type.is_created)
{
throw new InvalidOperationException("Type definition of the method is complete.");
}
if (il == null)
{
this.code = null;
}
else
{
this.code = new byte[count];
Array.Copy(il, this.code, count);
}
}
/// <summary>Dynamically invokes the method reflected by this instance on the given object, passing along the specified parameters, and under the constraints of the given binder.</summary>
/// <returns>Returns an object containing the return value of the invoked method.</returns>
/// <param name="obj">The object on which to invoke the specified method. If the method is static, this parameter is ignored. </param>
/// <param name="invokeAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </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 binder is null, the default binder is used. For more details, see <see cref="T:System.Reflection.Binder" />. </param>
/// <param name="parameters">An argument list. This is an array of arguments with the same number, order, and type as the parameters of the method to be invoked. If there are no parameters this should be null. </param>
/// <param name="culture">An instance of <see cref="T:System.Globalization.CultureInfo" /> used to govern the coercion of types. If this is null, the <see cref="T:System.Globalization.CultureInfo" /> for the current thread is used. (Note that this is necessary to, for example, convert a <see cref="T:System.String" /> that represents 1000 to a <see cref="T:System.Double" /> value, since 1000 is represented differently by different cultures.) </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the method using <see cref="M:System.Type.GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Type.InvokeMember(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object,System.Object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[])" /> on the returned <see cref="T:System.Reflection.MethodInfo" />. </exception>
// Token: 0x06001B15 RID: 6933 RVA: 0x00065AB4 File Offset: 0x00063CB4
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
throw this.NotSupported();
}
/// <summary>Checks if the specified custom attribute type is defined.</summary>
/// <returns>true if the specified custom attribute type is defined; otherwise, false.</returns>
/// <param name="attributeType">The custom attribute type. </param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the custom attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the method using <see cref="M:System.Type.GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean)" /> on the returned <see cref="T:System.Reflection.MethodInfo" />. </exception>
// Token: 0x06001B16 RID: 6934 RVA: 0x00065ABC File Offset: 0x00063CBC
public override bool IsDefined(Type attributeType, bool inherit)
{
throw this.NotSupported();
}
/// <summary>Returns all the custom attributes defined for this method.</summary>
/// <returns>Returns an array of objects representing all the custom attributes of this method.</returns>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the custom attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the method using <see cref="M:System.Type.GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean)" /> on the returned <see cref="T:System.Reflection.MethodInfo" />. </exception>
// Token: 0x06001B17 RID: 6935 RVA: 0x00065AC4 File Offset: 0x00063CC4
public override object[] GetCustomAttributes(bool inherit)
{
if (this.type.is_created)
{
return MonoCustomAttrs.GetCustomAttributes(this, inherit);
}
throw this.NotSupported();
}
/// <summary>Returns the custom attributes identified by the given type.</summary>
/// <returns>Returns an array of objects representing the attributes of this method that are of type <paramref name="attributeType" />.</returns>
/// <param name="attributeType">The custom attribute type. </param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the custom attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported. Retrieve the method using <see cref="M:System.Type.GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Reflection.CallingConventions,System.Type[],System.Reflection.ParameterModifier[])" /> and call <see cref="M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean)" /> on the returned <see cref="T:System.Reflection.MethodInfo" />. </exception>
// Token: 0x06001B18 RID: 6936 RVA: 0x00065AE4 File Offset: 0x00063CE4
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
if (this.type.is_created)
{
return MonoCustomAttrs.GetCustomAttributes(this, attributeType, inherit);
}
throw this.NotSupported();
}
/// <summary>Returns an ILGenerator for this method with a default Microsoft intermediate language (MSIL) stream size of 64 bytes.</summary>
/// <returns>Returns an ILGenerator object for this method.</returns>
/// <exception cref="T:System.InvalidOperationException">The method should not have a body because of its <see cref="T:System.Reflection.MethodAttributes" /> or <see cref="T:System.Reflection.MethodImplAttributes" /> flags, for example because it has the <see cref="F:System.Reflection.MethodAttributes.PinvokeImpl" /> flag. -or-The method is a generic method, but not a generic method definition. That is, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
// Token: 0x06001B19 RID: 6937 RVA: 0x00065B08 File Offset: 0x00063D08
public ILGenerator GetILGenerator()
{
return this.GetILGenerator(64);
}
/// <summary>Returns an ILGenerator for this method with the specified Microsoft intermediate language (MSIL) stream size.</summary>
/// <returns>Returns an ILGenerator object for this method.</returns>
/// <param name="size">The size of the MSIL stream, in bytes. </param>
/// <exception cref="T:System.InvalidOperationException">The method should not have a body because of its <see cref="T:System.Reflection.MethodAttributes" /> or <see cref="T:System.Reflection.MethodImplAttributes" /> flags, for example because it has the <see cref="F:System.Reflection.MethodAttributes.PinvokeImpl" /> flag. -or-The method is a generic method, but not a generic method definition. That is, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
// Token: 0x06001B1A RID: 6938 RVA: 0x00065B14 File Offset: 0x00063D14
public ILGenerator GetILGenerator(int size)
{
if ((this.iattrs & MethodImplAttributes.CodeTypeMask) != MethodImplAttributes.IL || (this.iattrs & MethodImplAttributes.ManagedMask) != MethodImplAttributes.IL)
{
throw new InvalidOperationException("Method body should not exist.");
}
if (this.ilgen != null)
{
return this.ilgen;
}
this.ilgen = new ILGenerator(this.type.Module, ((ModuleBuilder)this.type.Module).GetTokenGenerator(), size);
return this.ilgen;
}
/// <summary>Sets the parameter attributes and the name of a parameter of this method, or of the return value of this method. Returns a ParameterBuilder that can be used to apply custom attributes.</summary>
/// <returns>Returns a ParameterBuilder object that represents a parameter of this method or the return value of this method.</returns>
/// <param name="position">The position of the parameter in the parameter list. Parameters are indexed beginning with the number 1 for the first parameter; the number 0 represents the return value of the method. </param>
/// <param name="attributes">The parameter attributes of the parameter. </param>
/// <param name="strParamName">The name of the parameter. The name can be the null string. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The method has no parameters.-or- <paramref name="position" /> is less than zero.-or- <paramref name="position" /> is greater than the number of the method's parameters. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
// Token: 0x06001B1B RID: 6939 RVA: 0x00065B8C File Offset: 0x00063D8C
public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, string strParamName)
{
this.RejectIfCreated();
if (position < 0 || position > this.parameters.Length)
{
throw new ArgumentOutOfRangeException("position");
}
ParameterBuilder parameterBuilder = new ParameterBuilder(this, position, attributes, strParamName);
if (this.pinfo == null)
{
this.pinfo = new ParameterBuilder[this.parameters.Length + 1];
}
this.pinfo[position] = parameterBuilder;
return parameterBuilder;
}
// Token: 0x06001B1C RID: 6940 RVA: 0x00065BF4 File Offset: 0x00063DF4
internal void check_override()
{
if (this.override_method != null && this.override_method.IsVirtual && !this.IsVirtual)
{
throw new TypeLoadException(string.Format("Method '{0}' override '{1}' but it is not virtual", this.name, this.override_method));
}
}
// Token: 0x06001B1D RID: 6941 RVA: 0x00065C44 File Offset: 0x00063E44
internal void fixup()
{
if ((this.attrs & (MethodAttributes.Abstract | MethodAttributes.PinvokeImpl)) == MethodAttributes.PrivateScope && (this.iattrs & (MethodImplAttributes)4099) == MethodImplAttributes.IL && (this.ilgen == null || ILGenerator.Mono_GetCurrentOffset(this.ilgen) == 0) && (this.code == null || this.code.Length == 0))
{
throw new InvalidOperationException(string.Format("Method '{0}.{1}' does not have a method body.", this.DeclaringType.FullName, this.Name));
}
if (this.ilgen != null)
{
this.ilgen.label_fixup();
}
}
// Token: 0x06001B1E RID: 6942 RVA: 0x00065CE0 File Offset: 0x00063EE0
internal void GenerateDebugInfo(ISymbolWriter symbolWriter)
{
if (this.ilgen != null && this.ilgen.HasDebugInfo)
{
SymbolToken symbolToken = new SymbolToken(this.GetToken().Token);
symbolWriter.OpenMethod(symbolToken);
symbolWriter.SetSymAttribute(symbolToken, "__name", Encoding.UTF8.GetBytes(this.Name));
this.ilgen.GenerateDebugInfo(symbolWriter);
symbolWriter.CloseMethod();
}
}
/// <summary>Sets a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to describe the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="customBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001B1F RID: 6943 RVA: 0x00065D54 File Offset: 0x00063F54
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
string fullName = customBuilder.Ctor.ReflectedType.FullName;
switch (fullName)
{
case "System.Runtime.CompilerServices.MethodImplAttribute":
{
byte[] data = customBuilder.Data;
int num2 = (int)data[2];
num2 |= (int)data[3] << 8;
this.iattrs |= (MethodImplAttributes)num2;
return;
}
case "System.Runtime.InteropServices.DllImportAttribute":
{
CustomAttributeBuilder.CustomAttributeInfo customAttributeInfo = CustomAttributeBuilder.decode_cattr(customBuilder);
bool flag = true;
this.pi_dll = (string)customAttributeInfo.ctorArgs[0];
if (this.pi_dll == null || this.pi_dll.Length == 0)
{
throw new ArgumentException("DllName cannot be empty");
}
this.native_cc = global::System.Runtime.InteropServices.CallingConvention.Winapi;
for (int i = 0; i < customAttributeInfo.namedParamNames.Length; i++)
{
string text = customAttributeInfo.namedParamNames[i];
object obj = customAttributeInfo.namedParamValues[i];
if (text == "CallingConvention")
{
this.native_cc = (CallingConvention)((int)obj);
}
else if (text == "CharSet")
{
this.charset = (CharSet)((int)obj);
}
else if (text == "EntryPoint")
{
this.pi_entry = (string)obj;
}
else if (text == "ExactSpelling")
{
this.ExactSpelling = (bool)obj;
}
else if (text == "SetLastError")
{
this.SetLastError = (bool)obj;
}
else if (text == "PreserveSig")
{
flag = (bool)obj;
}
else if (text == "BestFitMapping")
{
this.BestFitMapping = (bool)obj;
}
else if (text == "ThrowOnUnmappableChar")
{
this.ThrowOnUnmappableChar = (bool)obj;
}
}
this.attrs |= MethodAttributes.PinvokeImpl;
if (flag)
{
this.iattrs |= MethodImplAttributes.PreserveSig;
}
return;
}
case "System.Runtime.InteropServices.PreserveSigAttribute":
this.iattrs |= MethodImplAttributes.PreserveSig;
return;
case "System.Runtime.CompilerServices.SpecialNameAttribute":
this.attrs |= MethodAttributes.SpecialName;
return;
case "System.Security.SuppressUnmanagedCodeSecurityAttribute":
this.attrs |= MethodAttributes.HasSecurity;
break;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Sets a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001B20 RID: 6944 RVA: 0x00066088 File Offset: 0x00064288
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
if (con == null)
{
throw new ArgumentNullException("con");
}
if (binaryAttribute == null)
{
throw new ArgumentNullException("binaryAttribute");
}
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Sets the implementation flags for this method.</summary>
/// <param name="attributes">The implementation flags to set. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
// Token: 0x06001B21 RID: 6945 RVA: 0x000660BC File Offset: 0x000642BC
public void SetImplementationFlags(MethodImplAttributes attributes)
{
this.RejectIfCreated();
this.iattrs = attributes;
}
/// <summary>Adds declarative security to this method.</summary>
/// <param name="action">The security action to be taken (Demand, Assert, and so on). </param>
/// <param name="pset">The set of permissions the action applies to. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="action" /> is invalid (RequestMinimum, RequestOptional, and RequestRefuse are invalid). </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-The permission set <paramref name="pset" /> contains an action that was added earlier by <see cref="M:System.Reflection.Emit.MethodBuilder.AddDeclarativeSecurity(System.Security.Permissions.SecurityAction,System.Security.PermissionSet)" />.-or-For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="pset" /> is null. </exception>
// Token: 0x06001B22 RID: 6946 RVA: 0x000660CC File Offset: 0x000642CC
public void AddDeclarativeSecurity(SecurityAction action, PermissionSet pset)
{
}
/// <summary>Sets marshaling information for the return type of this method.</summary>
/// <param name="unmanagedMarshal">Marshaling information for the return type of this method. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false. </exception>
// Token: 0x06001B23 RID: 6947 RVA: 0x000660D0 File Offset: 0x000642D0
[Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public void SetMarshal(UnmanagedMarshal unmanagedMarshal)
{
this.RejectIfCreated();
throw new NotImplementedException();
}
/// <summary>Set a symbolic custom attribute using a blob.</summary>
/// <param name="name">The name of the symbolic custom attribute. </param>
/// <param name="data">The byte blob that represents the value of the symbolic custom attribute. </param>
/// <exception cref="T:System.InvalidOperationException">The containing type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- The module that contains this method is not a debug module. -or-For the current method, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001B24 RID: 6948 RVA: 0x000660E0 File Offset: 0x000642E0
[MonoTODO]
public void SetSymCustomAttribute(string name, byte[] data)
{
this.RejectIfCreated();
throw new NotImplementedException();
}
/// <summary>Returns this MethodBuilder instance as a string.</summary>
/// <returns>Returns a string containing the name, attributes, method signature, exceptions, and local signature of this method followed by the current Microsoft intermediate language (MSIL) stream.</returns>
// Token: 0x06001B25 RID: 6949 RVA: 0x000660F0 File Offset: 0x000642F0
public override string ToString()
{
return string.Concat(new string[]
{
"MethodBuilder [",
this.type.Name,
"::",
this.name,
"]"
});
}
/// <summary>Determines whether the given object is equal to this instance.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of MethodBuilder and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare with this MethodBuilder instance. </param>
// Token: 0x06001B26 RID: 6950 RVA: 0x00066138 File Offset: 0x00064338
[MonoTODO]
public override bool Equals(object obj)
{
return base.Equals(obj);
}
/// <summary>Gets the hash code for this method.</summary>
/// <returns>The hash code for this method.</returns>
// Token: 0x06001B27 RID: 6951 RVA: 0x00066144 File Offset: 0x00064344
public override int GetHashCode()
{
return this.name.GetHashCode();
}
// Token: 0x06001B28 RID: 6952 RVA: 0x00066154 File Offset: 0x00064354
internal override int get_next_table_index(object obj, int table, bool inc)
{
return this.type.get_next_table_index(obj, table, inc);
}
// Token: 0x06001B29 RID: 6953 RVA: 0x00066164 File Offset: 0x00064364
internal void set_override(MethodInfo mdecl)
{
this.override_method = mdecl;
}
// Token: 0x06001B2A RID: 6954 RVA: 0x00066170 File Offset: 0x00064370
private void RejectIfCreated()
{
if (this.type.is_created)
{
throw new InvalidOperationException("Type definition of the method is complete.");
}
}
// Token: 0x06001B2B RID: 6955 RVA: 0x00066190 File Offset: 0x00064390
private Exception NotSupported()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
/// <summary>Returns a generic method constructed from the current generic method definition using the specified generic type arguments.</summary>
/// <returns>A <see cref="T:System.Reflection.MethodInfo" /> representing the generic method constructed from the current generic method definition using the specified generic type arguments.</returns>
/// <param name="typeArguments">An array of <see cref="T:System.Type" /> objects that represent the type arguments for the generic method.</param>
// Token: 0x06001B2C RID: 6956
[MethodImpl(MethodImplOptions.InternalCall)]
public override extern MethodInfo MakeGenericMethod(params Type[] typeArguments);
/// <summary>Gets a value indicating whether the current <see cref="T:System.Reflection.Emit.MethodBuilder" /> object represents the definition of a generic method.</summary>
/// <returns>true if the current <see cref="T:System.Reflection.Emit.MethodBuilder" /> object represents the definition of a generic method; otherwise, false.</returns>
// Token: 0x170004D9 RID: 1241
// (get) Token: 0x06001B2D RID: 6957 RVA: 0x0006619C File Offset: 0x0006439C
public override bool IsGenericMethodDefinition
{
get
{
return this.generic_params != null;
}
}
/// <summary>Gets a value indicating whether the method is a generic method.</summary>
/// <returns>true if the method is generic; otherwise, false.</returns>
// Token: 0x170004DA RID: 1242
// (get) Token: 0x06001B2E RID: 6958 RVA: 0x000661AC File Offset: 0x000643AC
public override bool IsGenericMethod
{
get
{
return this.generic_params != null;
}
}
/// <summary>Returns this method.</summary>
/// <returns>The current instance of <see cref="T:System.Reflection.Emit.MethodBuilder" />. </returns>
/// <exception cref="T:System.InvalidOperationException">The current method is not generic. That is, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property returns false.</exception>
// Token: 0x06001B2F RID: 6959 RVA: 0x000661BC File Offset: 0x000643BC
public override MethodInfo GetGenericMethodDefinition()
{
if (!this.IsGenericMethodDefinition)
{
throw new InvalidOperationException();
}
return this;
}
/// <summary>Returns an array of <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> objects that represent the type parameters of the method, if it is generic.</summary>
/// <returns>An array of <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> objects representing the type parameters, if the method is generic, or null if the method is not generic. </returns>
// Token: 0x06001B30 RID: 6960 RVA: 0x000661D0 File Offset: 0x000643D0
public override Type[] GetGenericArguments()
{
if (this.generic_params == null)
{
return Type.EmptyTypes;
}
Type[] array = new Type[this.generic_params.Length];
for (int i = 0; i < this.generic_params.Length; i++)
{
array[i] = this.generic_params[i];
}
return array;
}
/// <summary>Sets the number of generic type parameters for the current method, specifies their names, and returns an array of <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> objects that can be used to define their constraints.</summary>
/// <returns>An array of <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> objects representing the type parameters of the generic method.</returns>
/// <param name="names">An array of strings that represent the names of the generic type parameters.</param>
/// <exception cref="T:System.InvalidOperationException">Generic type parameters have already been defined for this method.-or-The method has been completed already.-or-The <see cref="M:System.Reflection.Emit.MethodBuilder.SetImplementationFlags(System.Reflection.MethodImplAttributes)" /> method has been called for the current method.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="names" /> is null.-or-An element of <paramref name="names" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="names" /> is an empty array.</exception>
// Token: 0x06001B31 RID: 6961 RVA: 0x00066224 File Offset: 0x00064424
public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names)
{
if (names == null)
{
throw new ArgumentNullException("names");
}
if (names.Length == 0)
{
throw new ArgumentException("names");
}
this.generic_params = new GenericTypeParameterBuilder[names.Length];
for (int i = 0; i < names.Length; i++)
{
string text = names[i];
if (text == null)
{
throw new ArgumentNullException("names");
}
this.generic_params[i] = new GenericTypeParameterBuilder(this.type, this, text, i);
}
return this.generic_params;
}
/// <summary>Sets the return type of the method.</summary>
/// <param name="returnType">A <see cref="T:System.Type" /> object that represents the return type of the method.</param>
/// <exception cref="T:System.InvalidOperationException">The current method is generic, but is not a generic method definition. That is, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001B32 RID: 6962 RVA: 0x000662A8 File Offset: 0x000644A8
public void SetReturnType(Type returnType)
{
this.rtype = returnType;
}
/// <summary>Sets the number and types of parameters for a method. </summary>
/// <param name="parameterTypes">An array of <see cref="T:System.Type" /> objects representing the parameter types.</param>
/// <exception cref="T:System.InvalidOperationException">The current method is generic, but is not a generic method definition. That is, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001B33 RID: 6963 RVA: 0x000662B4 File Offset: 0x000644B4
public void SetParameters(params Type[] parameterTypes)
{
if (parameterTypes != null)
{
for (int i = 0; i < parameterTypes.Length; i++)
{
if (parameterTypes[i] == null)
{
throw new ArgumentException("Elements of the parameterTypes array cannot be null", "parameterTypes");
}
}
this.parameters = new Type[parameterTypes.Length];
Array.Copy(parameterTypes, this.parameters, parameterTypes.Length);
}
}
/// <summary>Sets the method signature, including the return type, the parameter types, and the required and optional custom modifiers of the return type and parameter types.</summary>
/// <param name="returnType">The return type of the method.</param>
/// <param name="returnTypeRequiredCustomModifiers">An array of types representing the required custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the method. If the return type has no required custom modifiers, specify null.</param>
/// <param name="returnTypeOptionalCustomModifiers">An array of types representing the optional custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the method. If the return type has no optional custom modifiers, specify null.</param>
/// <param name="parameterTypes">The types of the parameters of the method.</param>
/// <param name="parameterTypeRequiredCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no required custom modifiers, specify null instead of an array of types. If none of the parameters have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="parameterTypeOptionalCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no optional custom modifiers, specify null instead of an array of types. If none of the parameters have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.InvalidOperationException">The current method is generic, but is not a generic method definition. That is, the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethod" /> property is true, but the <see cref="P:System.Reflection.Emit.MethodBuilder.IsGenericMethodDefinition" /> property is false.</exception>
// Token: 0x06001B34 RID: 6964 RVA: 0x00066310 File Offset: 0x00064510
public void SetSignature(Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
{
this.SetReturnType(returnType);
this.SetParameters(parameterTypes);
this.returnModReq = returnTypeRequiredCustomModifiers;
this.returnModOpt = returnTypeOptionalCustomModifiers;
this.paramModReq = parameterTypeRequiredCustomModifiers;
this.paramModOpt = parameterTypeOptionalCustomModifiers;
}
/// <summary>Gets the module in which the current method is being defined.</summary>
/// <returns>The <see cref="T:System.Reflection.Module" /> in which the member represented by the current <see cref="T:System.Reflection.MemberInfo" /> is being defined.</returns>
// Token: 0x170004DB RID: 1243
// (get) Token: 0x06001B35 RID: 6965 RVA: 0x00066340 File Offset: 0x00064540
public override Module Module
{
get
{
return base.Module;
}
}
// Token: 0x0400080E RID: 2062
private RuntimeMethodHandle mhandle;
// Token: 0x0400080F RID: 2063
private Type rtype;
// Token: 0x04000810 RID: 2064
internal Type[] parameters;
// Token: 0x04000811 RID: 2065
private MethodAttributes attrs;
// Token: 0x04000812 RID: 2066
private MethodImplAttributes iattrs;
// Token: 0x04000813 RID: 2067
private string name;
// Token: 0x04000814 RID: 2068
private int table_idx;
// Token: 0x04000815 RID: 2069
private byte[] code;
// Token: 0x04000816 RID: 2070
private ILGenerator ilgen;
// Token: 0x04000817 RID: 2071
private TypeBuilder type;
// Token: 0x04000818 RID: 2072
internal ParameterBuilder[] pinfo;
// Token: 0x04000819 RID: 2073
private CustomAttributeBuilder[] cattrs;
// Token: 0x0400081A RID: 2074
private MethodInfo override_method;
// Token: 0x0400081B RID: 2075
private string pi_dll;
// Token: 0x0400081C RID: 2076
private string pi_entry;
// Token: 0x0400081D RID: 2077
private CharSet charset;
// Token: 0x0400081E RID: 2078
private uint extra_flags;
// Token: 0x0400081F RID: 2079
private CallingConvention native_cc;
// Token: 0x04000820 RID: 2080
private CallingConventions call_conv;
// Token: 0x04000821 RID: 2081
private bool init_locals = true;
// Token: 0x04000822 RID: 2082
private IntPtr generic_container;
// Token: 0x04000823 RID: 2083
internal GenericTypeParameterBuilder[] generic_params;
// Token: 0x04000824 RID: 2084
private Type[] returnModReq;
// Token: 0x04000825 RID: 2085
private Type[] returnModOpt;
// Token: 0x04000826 RID: 2086
private Type[][] paramModReq;
// Token: 0x04000827 RID: 2087
private Type[][] paramModOpt;
// Token: 0x04000828 RID: 2088
private RefEmitPermissionSet[] permissions;
}
}
@@ -0,0 +1,307 @@
using System;
using System.Globalization;
using System.Text;
namespace System.Reflection.Emit
{
// Token: 0x02000204 RID: 516
internal class MethodOnTypeBuilderInst : MethodInfo
{
// Token: 0x06001B36 RID: 6966 RVA: 0x00066348 File Offset: 0x00064548
public MethodOnTypeBuilderInst(MonoGenericClass instantiation, MethodBuilder mb)
{
this.instantiation = instantiation;
this.mb = mb;
}
// Token: 0x06001B37 RID: 6967 RVA: 0x00066360 File Offset: 0x00064560
internal MethodOnTypeBuilderInst(MethodOnTypeBuilderInst gmd, Type[] typeArguments)
{
this.instantiation = gmd.instantiation;
this.mb = gmd.mb;
this.method_arguments = new Type[typeArguments.Length];
typeArguments.CopyTo(this.method_arguments, 0);
this.generic_method_definition = gmd;
}
// Token: 0x170004DC RID: 1244
// (get) Token: 0x06001B38 RID: 6968 RVA: 0x000663B0 File Offset: 0x000645B0
public override Type DeclaringType
{
get
{
return this.instantiation;
}
}
// Token: 0x170004DD RID: 1245
// (get) Token: 0x06001B39 RID: 6969 RVA: 0x000663B8 File Offset: 0x000645B8
public override string Name
{
get
{
return this.mb.Name;
}
}
// Token: 0x170004DE RID: 1246
// (get) Token: 0x06001B3A RID: 6970 RVA: 0x000663C8 File Offset: 0x000645C8
public override Type ReflectedType
{
get
{
return this.instantiation;
}
}
// Token: 0x170004DF RID: 1247
// (get) Token: 0x06001B3B RID: 6971 RVA: 0x000663D0 File Offset: 0x000645D0
public override Type ReturnType
{
get
{
if (!((ModuleBuilder)this.mb.Module).assemblyb.IsCompilerContext)
{
return this.mb.ReturnType;
}
return this.instantiation.InflateType(this.mb.ReturnType, this.method_arguments);
}
}
// Token: 0x06001B3C RID: 6972 RVA: 0x00066424 File Offset: 0x00064624
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001B3D RID: 6973 RVA: 0x0006642C File Offset: 0x0006462C
public override object[] GetCustomAttributes(bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001B3E RID: 6974 RVA: 0x00066434 File Offset: 0x00064634
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001B3F RID: 6975 RVA: 0x0006643C File Offset: 0x0006463C
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(this.ReturnType.ToString());
stringBuilder.Append(" ");
stringBuilder.Append(this.mb.Name);
stringBuilder.Append("(");
if (((ModuleBuilder)this.mb.Module).assemblyb.IsCompilerContext)
{
ParameterInfo[] parameters = this.GetParameters();
for (int i = 0; i < parameters.Length; i++)
{
if (i > 0)
{
stringBuilder.Append(", ");
}
stringBuilder.Append(parameters[i].ParameterType);
}
}
stringBuilder.Append(")");
return stringBuilder.ToString();
}
// Token: 0x06001B40 RID: 6976 RVA: 0x000664F4 File Offset: 0x000646F4
public override MethodImplAttributes GetMethodImplementationFlags()
{
return this.mb.GetMethodImplementationFlags();
}
// Token: 0x06001B41 RID: 6977 RVA: 0x00066504 File Offset: 0x00064704
public override ParameterInfo[] GetParameters()
{
if (!((ModuleBuilder)this.mb.Module).assemblyb.IsCompilerContext)
{
throw new NotSupportedException();
}
ParameterInfo[] array = new ParameterInfo[this.mb.parameters.Length];
for (int i = 0; i < this.mb.parameters.Length; i++)
{
Type type = this.instantiation.InflateType(this.mb.parameters[i], this.method_arguments);
array[i] = new ParameterInfo((this.mb.pinfo != null) ? this.mb.pinfo[i + 1] : null, type, this, i + 1);
}
return array;
}
// Token: 0x170004E0 RID: 1248
// (get) Token: 0x06001B42 RID: 6978 RVA: 0x000665BC File Offset: 0x000647BC
public override int MetadataToken
{
get
{
if (!((ModuleBuilder)this.mb.Module).assemblyb.IsCompilerContext)
{
return base.MetadataToken;
}
return this.mb.MetadataToken;
}
}
// Token: 0x06001B43 RID: 6979 RVA: 0x000665FC File Offset: 0x000647FC
internal override int GetParameterCount()
{
return this.mb.GetParameterCount();
}
// Token: 0x06001B44 RID: 6980 RVA: 0x0006660C File Offset: 0x0006480C
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
throw new NotSupportedException();
}
// Token: 0x170004E1 RID: 1249
// (get) Token: 0x06001B45 RID: 6981 RVA: 0x00066614 File Offset: 0x00064814
public override RuntimeMethodHandle MethodHandle
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x170004E2 RID: 1250
// (get) Token: 0x06001B46 RID: 6982 RVA: 0x0006661C File Offset: 0x0006481C
public override MethodAttributes Attributes
{
get
{
return this.mb.Attributes;
}
}
// Token: 0x170004E3 RID: 1251
// (get) Token: 0x06001B47 RID: 6983 RVA: 0x0006662C File Offset: 0x0006482C
public override CallingConventions CallingConvention
{
get
{
return this.mb.CallingConvention;
}
}
// Token: 0x06001B48 RID: 6984 RVA: 0x0006663C File Offset: 0x0006483C
public override MethodInfo MakeGenericMethod(params Type[] typeArguments)
{
if (this.mb.generic_params == null || this.method_arguments != null)
{
throw new NotSupportedException();
}
if (typeArguments == null)
{
throw new ArgumentNullException("typeArguments");
}
for (int i = 0; i < typeArguments.Length; i++)
{
if (typeArguments[i] == null)
{
throw new ArgumentNullException("typeArguments");
}
}
if (this.mb.generic_params.Length != typeArguments.Length)
{
throw new ArgumentException("Invalid argument array length");
}
return new MethodOnTypeBuilderInst(this, typeArguments);
}
// Token: 0x06001B49 RID: 6985 RVA: 0x000666D0 File Offset: 0x000648D0
public override Type[] GetGenericArguments()
{
if (this.mb.generic_params == null)
{
return null;
}
Type[] array = this.method_arguments ?? this.mb.generic_params;
Type[] array2 = new Type[array.Length];
array.CopyTo(array2, 0);
return array2;
}
// Token: 0x06001B4A RID: 6986 RVA: 0x0006671C File Offset: 0x0006491C
public override MethodInfo GetGenericMethodDefinition()
{
return this.generic_method_definition ?? this.mb;
}
// Token: 0x170004E4 RID: 1252
// (get) Token: 0x06001B4B RID: 6987 RVA: 0x00066734 File Offset: 0x00064934
public override bool ContainsGenericParameters
{
get
{
if (this.mb.generic_params == null)
{
throw new NotSupportedException();
}
if (this.method_arguments == null)
{
return true;
}
foreach (Type type in this.method_arguments)
{
if (type.ContainsGenericParameters)
{
return true;
}
}
return false;
}
}
// Token: 0x170004E5 RID: 1253
// (get) Token: 0x06001B4C RID: 6988 RVA: 0x00066794 File Offset: 0x00064994
public override bool IsGenericMethodDefinition
{
get
{
return this.mb.generic_params != null && this.method_arguments == null;
}
}
// Token: 0x170004E6 RID: 1254
// (get) Token: 0x06001B4D RID: 6989 RVA: 0x000667B4 File Offset: 0x000649B4
public override bool IsGenericMethod
{
get
{
return this.mb.generic_params != null;
}
}
// Token: 0x06001B4E RID: 6990 RVA: 0x000667C8 File Offset: 0x000649C8
public override MethodInfo GetBaseDefinition()
{
throw new NotSupportedException();
}
// Token: 0x170004E7 RID: 1255
// (get) Token: 0x06001B4F RID: 6991 RVA: 0x000667D0 File Offset: 0x000649D0
public override ICustomAttributeProvider ReturnTypeCustomAttributes
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x0400082A RID: 2090
private MonoGenericClass instantiation;
// Token: 0x0400082B RID: 2091
internal MethodBuilder mb;
// Token: 0x0400082C RID: 2092
private Type[] method_arguments;
// Token: 0x0400082D RID: 2093
private MethodOnTypeBuilderInst generic_method_definition;
}
}
@@ -0,0 +1,108 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Provides a fast way to swap method body implementation given a method of a class.</summary>
// Token: 0x02000205 RID: 517
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_MethodRental))]
public sealed class MethodRental : _MethodRental
{
// Token: 0x06001B50 RID: 6992 RVA: 0x000667D8 File Offset: 0x000649D8
private MethodRental()
{
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B51 RID: 6993 RVA: 0x000667E0 File Offset: 0x000649E0
void _MethodRental.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B52 RID: 6994 RVA: 0x000667E8 File Offset: 0x000649E8
void _MethodRental.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B53 RID: 6995 RVA: 0x000667F0 File Offset: 0x000649F0
void _MethodRental.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B54 RID: 6996 RVA: 0x000667F8 File Offset: 0x000649F8
void _MethodRental.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Swaps the body of a method.</summary>
/// <param name="cls">The class containing the method. </param>
/// <param name="methodtoken">The token for the method. </param>
/// <param name="rgIL">A pointer to the method. This should include the method header. </param>
/// <param name="methodSize">The size of the new method body in bytes. </param>
/// <param name="flags">Flags that control the swapping. See the definitions of the constants. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="cls" /> is null. </exception>
/// <exception cref="T:System.NotSupportedException">The type <paramref name="cls" /> is not complete. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="methodSize" /> is less than one or greater than 4128767 (3effff hex).</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001B55 RID: 6997 RVA: 0x00066800 File Offset: 0x00064A00
[MonoTODO]
public static void SwapMethodBody(Type cls, int methodtoken, IntPtr rgIL, int methodSize, int flags)
{
if (methodSize <= 0 || methodSize >= 4128768)
{
throw new ArgumentException("Data size must be > 0 and < 0x3f0000", "methodSize");
}
if (cls == null)
{
throw new ArgumentNullException("cls");
}
if (cls is TypeBuilder && !((TypeBuilder)cls).is_created)
{
throw new NotSupportedException("Type '" + cls + "' is not yet created.");
}
throw new NotImplementedException();
}
/// <summary>Specifies that the method should be just-in-time (JIT) compiled immediately.</summary>
// Token: 0x0400082E RID: 2094
public const int JitImmediate = 1;
/// <summary>Specifies that the method should be just-in-time (JIT) compiled when needed.</summary>
// Token: 0x0400082F RID: 2095
public const int JitOnDemand = 0;
}
}
@@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>The MethodToken struct is an object representation of a token that represents a method.</summary>
// Token: 0x02000206 RID: 518
[ComVisible(true)]
[Serializable]
public struct MethodToken
{
// Token: 0x06001B56 RID: 6998 RVA: 0x00066878 File Offset: 0x00064A78
internal MethodToken(int val)
{
this.tokValue = val;
}
/// <summary>Tests whether the given object is equal to this MethodToken object.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of MethodToken and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare to this object. </param>
// Token: 0x06001B58 RID: 7000 RVA: 0x000668A0 File Offset: 0x00064AA0
public override bool Equals(object obj)
{
bool flag = obj is MethodToken;
if (flag)
{
MethodToken methodToken = (MethodToken)obj;
flag = this.tokValue == methodToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.MethodToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.MethodToken" /> to compare to the current instance.</param>
// Token: 0x06001B59 RID: 7001 RVA: 0x000668D8 File Offset: 0x00064AD8
public bool Equals(MethodToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Returns the generated hash code for this method.</summary>
/// <returns>Returns the hash code for this instance.</returns>
// Token: 0x06001B5A RID: 7002 RVA: 0x000668EC File Offset: 0x00064AEC
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Returns the metadata token for this method.</summary>
/// <returns>Read-only. Returns the metadata token for this method.</returns>
// Token: 0x170004E8 RID: 1256
// (get) Token: 0x06001B5B RID: 7003 RVA: 0x000668F4 File Offset: 0x00064AF4
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.MethodToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.MethodToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.MethodToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001B5C RID: 7004 RVA: 0x000668FC File Offset: 0x00064AFC
public static bool operator ==(MethodToken a, MethodToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.MethodToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.MethodToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.MethodToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001B5D RID: 7005 RVA: 0x00066910 File Offset: 0x00064B10
public static bool operator !=(MethodToken a, MethodToken b)
{
return !object.Equals(a, b);
}
// Token: 0x04000830 RID: 2096
internal int tokValue;
/// <summary>The default MethodToken with <see cref="P:System.Reflection.Emit.MethodToken.Token" /> value 0.</summary>
// Token: 0x04000831 RID: 2097
public static readonly MethodToken Empty = default(MethodToken);
}
}
@@ -0,0 +1,1434 @@
using System;
using System.Collections;
using System.Diagnostics.SymbolStore;
using System.Globalization;
using System.IO;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines and represents a module in a dynamic assembly.</summary>
// Token: 0x02000207 RID: 519
[ComVisible(true)]
[ComDefaultInterface(typeof(_ModuleBuilder))]
[ClassInterface(ClassInterfaceType.None)]
public class ModuleBuilder : Module, _ModuleBuilder
{
// Token: 0x06001B5E RID: 7006 RVA: 0x00066928 File Offset: 0x00064B28
internal ModuleBuilder(AssemblyBuilder assb, string name, string fullyqname, bool emitSymbolInfo, bool transient)
{
this.scopename = name;
this.name = name;
this.fqname = fullyqname;
this.assemblyb = assb;
this.assembly = assb;
this.transient = transient;
this.guid = Guid.FastNewGuidArray();
this.table_idx = this.get_next_table_index(this, 0, true);
this.name_cache = new Hashtable();
ModuleBuilder.basic_init(this);
this.CreateGlobalType();
if (assb.IsRun)
{
TypeBuilder typeBuilder = new TypeBuilder(this, TypeAttributes.Abstract, 16777215);
Type type = typeBuilder.CreateType();
ModuleBuilder.set_wrappers_type(this, type);
}
if (emitSymbolInfo)
{
Assembly assembly = Assembly.LoadWithPartialName("Mono.CompilerServices.SymbolWriter");
if (assembly == null)
{
throw new ExecutionEngineException("The assembly for default symbol writer cannot be loaded");
}
Type type2 = assembly.GetType("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl");
if (type2 == null)
{
throw new ExecutionEngineException("The type that implements the default symbol writer interface cannot be found");
}
this.symbolWriter = (ISymbolWriter)Activator.CreateInstance(type2, new object[] { this });
string text = this.fqname;
if (this.assemblyb.AssemblyDir != null)
{
text = Path.Combine(this.assemblyb.AssemblyDir, text);
}
this.symbolWriter.Initialize(IntPtr.Zero, text, true);
}
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B60 RID: 7008 RVA: 0x00066A8C File Offset: 0x00064C8C
void _ModuleBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B61 RID: 7009 RVA: 0x00066A94 File Offset: 0x00064C94
void _ModuleBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B62 RID: 7010 RVA: 0x00066A9C File Offset: 0x00064C9C
void _ModuleBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001B63 RID: 7011 RVA: 0x00066AA4 File Offset: 0x00064CA4
void _ModuleBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x06001B64 RID: 7012
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void basic_init(ModuleBuilder ab);
// Token: 0x06001B65 RID: 7013
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void set_wrappers_type(ModuleBuilder mb, Type ab);
/// <summary>Gets a String representing the fully-qualified name and path to this module.</summary>
/// <returns>The fully-qualified module name.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x170004E9 RID: 1257
// (get) Token: 0x06001B66 RID: 7014 RVA: 0x00066AAC File Offset: 0x00064CAC
public override string FullyQualifiedName
{
get
{
return this.fqname;
}
}
/// <summary>Checks if this dynamic module is transient.</summary>
/// <returns>Returns true if this dynamic module is transient; otherwise, false.</returns>
// Token: 0x06001B67 RID: 7015 RVA: 0x00066AB4 File Offset: 0x00064CB4
public bool IsTransient()
{
return this.transient;
}
/// <summary>Completes the global function definitions and global data definitions for this dynamic module.</summary>
/// <exception cref="T:System.InvalidOperationException">This method was called previously. </exception>
// Token: 0x06001B68 RID: 7016 RVA: 0x00066ABC File Offset: 0x00064CBC
public void CreateGlobalFunctions()
{
if (this.global_type_created != null)
{
throw new InvalidOperationException("global methods already created");
}
if (this.global_type != null)
{
this.global_type_created = this.global_type.CreateType();
}
}
/// <summary>Defines an initialized data field in the .sdata section of the portable executable (PE) file.</summary>
/// <returns>A field to reference the data.</returns>
/// <param name="name">The name used to refer to the data. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="data">The blob of data. </param>
/// <param name="attributes">The attributes for the field. The default is Static. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- The size of <paramref name="data" /> is less than or equal to zero or greater than or equal to 0x3f0000. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="data" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called. </exception>
// Token: 0x06001B69 RID: 7017 RVA: 0x00066AFC File Offset: 0x00064CFC
public FieldBuilder DefineInitializedData(string name, byte[] data, FieldAttributes attributes)
{
if (data == null)
{
throw new ArgumentNullException("data");
}
FieldBuilder fieldBuilder = this.DefineUninitializedData(name, data.Length, attributes | FieldAttributes.HasFieldRVA);
fieldBuilder.SetRVAData(data);
return fieldBuilder;
}
/// <summary>Defines an uninitialized data field in the .sdata section of the portable executable (PE) file.</summary>
/// <returns>A field to reference the data.</returns>
/// <param name="name">The name used to refer to the data. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="size">The size of the data field. </param>
/// <param name="attributes">The attributes for the field. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- <paramref name="size" /> is less than or equal to zero or greater than or equal to 0x003f0000. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called. </exception>
// Token: 0x06001B6A RID: 7018 RVA: 0x00066B34 File Offset: 0x00064D34
public FieldBuilder DefineUninitializedData(string name, int size, FieldAttributes attributes)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (this.global_type_created != null)
{
throw new InvalidOperationException("global fields already created");
}
if (size <= 0 || size > 4128768)
{
throw new ArgumentException("size", "Data size must be > 0 and < 0x3f0000");
}
this.CreateGlobalType();
string text = "$ArrayType$" + size;
Type type = this.GetType(text, false, false);
if (type == null)
{
TypeBuilder typeBuilder = this.DefineType(text, TypeAttributes.Public | TypeAttributes.ExplicitLayout | TypeAttributes.Sealed, this.assemblyb.corlib_value_type, null, PackingSize.Size1, size);
typeBuilder.CreateType();
type = typeBuilder;
}
FieldBuilder fieldBuilder = this.global_type.DefineField(name, type, attributes | FieldAttributes.Static);
if (this.global_fields != null)
{
FieldBuilder[] array = new FieldBuilder[this.global_fields.Length + 1];
Array.Copy(this.global_fields, array, this.global_fields.Length);
array[this.global_fields.Length] = fieldBuilder;
this.global_fields = array;
}
else
{
this.global_fields = new FieldBuilder[1];
this.global_fields[0] = fieldBuilder;
}
return fieldBuilder;
}
// Token: 0x06001B6B RID: 7019 RVA: 0x00066C48 File Offset: 0x00064E48
private void addGlobalMethod(MethodBuilder mb)
{
if (this.global_methods != null)
{
MethodBuilder[] array = new MethodBuilder[this.global_methods.Length + 1];
Array.Copy(this.global_methods, array, this.global_methods.Length);
array[this.global_methods.Length] = mb;
this.global_methods = array;
}
else
{
this.global_methods = new MethodBuilder[1];
this.global_methods[0] = mb;
}
}
/// <summary>Defines a global method given its name, attributes, return type, and parameter types.</summary>
/// <returns>Returns the defined global method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. Must include <see cref="F:System.Reflection.MethodAttributes.Static" />. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <exception cref="T:System.ArgumentException">The method is not static. That is, <paramref name="attributes" /> does not include <see cref="F:System.Reflection.MethodAttributes.Static" />.-or- The length of <paramref name="name" /> is zero -or-An element in the <see cref="T:System.Type" /> array is null.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called. </exception>
// Token: 0x06001B6C RID: 7020 RVA: 0x00066CB0 File Offset: 0x00064EB0
public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)
{
return this.DefineGlobalMethod(name, attributes, CallingConventions.Standard, returnType, parameterTypes);
}
/// <summary>Defines a global method given its name, attributes, calling convention, return type, and parameter types.</summary>
/// <returns>Returns the defined global method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. Must include <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
/// <param name="callingConvention">The calling convention for the method. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <exception cref="T:System.ArgumentException">The method is not static. That is, <paramref name="attributes" /> does not include <see cref="F:System.Reflection.MethodAttributes.Static" />.-or-An element in the <see cref="T:System.Type" /> array is null.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> has been previously called. </exception>
// Token: 0x06001B6D RID: 7021 RVA: 0x00066CC0 File Offset: 0x00064EC0
public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
{
return this.DefineGlobalMethod(name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null);
}
/// <summary>Defines a global method given its name, attributes, calling convention, return type, custom modifiers for the return type, parameter types, and custom modifiers for the parameter types.</summary>
/// <returns>Returns the defined global method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded null characters. </param>
/// <param name="attributes">The attributes of the method. Must include <see cref="F:System.Reflection.MethodAttributes.Static" />.</param>
/// <param name="callingConvention">The calling convention for the method. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="requiredReturnTypeCustomModifiers">An array of types representing the required custom modifiers for the return type, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the return type has no required custom modifiers, specify null. </param>
/// <param name="optionalReturnTypeCustomModifiers">An array of types representing the optional custom modifiers for the return type, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the return type has no optional custom modifiers, specify null. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <param name="requiredParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter of the global method. If a particular argument has no required custom modifiers, specify null instead of an array of types. If the global method has no arguments, or if none of the arguments have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="optionalParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter. If a particular argument has no optional custom modifiers, specify null instead of an array of types. If the global method has no arguments, or if none of the arguments have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.ArgumentException">The method is not static. That is, <paramref name="attributes" /> does not include <see cref="F:System.Reflection.MethodAttributes.Static" />.-or-An element in the <see cref="T:System.Type" /> array is null.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The <see cref="M:System.Reflection.Emit.ModuleBuilder.CreateGlobalFunctions" /> method has been previously called. </exception>
// Token: 0x06001B6E RID: 7022 RVA: 0x00066CE0 File Offset: 0x00064EE0
public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if ((attributes & MethodAttributes.Static) == MethodAttributes.PrivateScope)
{
throw new ArgumentException("global methods must be static");
}
if (this.global_type_created != null)
{
throw new InvalidOperationException("global methods already created");
}
this.CreateGlobalType();
MethodBuilder methodBuilder = this.global_type.DefineMethod(name, attributes, callingConvention, returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers, parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
this.addGlobalMethod(methodBuilder);
return methodBuilder;
}
/// <summary>Defines a PInvoke method given its name, the name of the DLL in which the method is defined, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, and the PInvoke flags.</summary>
/// <returns>The defined PInvoke method.</returns>
/// <param name="name">The name of the PInvoke method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="dllName">The name of the DLL in which the PInvoke method is defined. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The method's calling convention. </param>
/// <param name="returnType">The method's return type. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <param name="nativeCallConv">The native calling convention. </param>
/// <param name="nativeCharSet">The method's native character set. </param>
/// <exception cref="T:System.ArgumentException">The method is not static or if the containing type is an interface.-or- The method is abstract.-or- The method was previously defined. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="dllName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /></exception>
// Token: 0x06001B6F RID: 7023 RVA: 0x00066D54 File Offset: 0x00064F54
public MethodBuilder DefinePInvokeMethod(string name, string dllName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet)
{
return this.DefinePInvokeMethod(name, dllName, name, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet);
}
/// <summary>Defines a PInvoke method given its name, the name of the DLL in which the method is defined, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, and the PInvoke flags.</summary>
/// <returns>The defined PInvoke method.</returns>
/// <param name="name">The name of the PInvoke method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="dllName">The name of the DLL in which the PInvoke method is defined. </param>
/// <param name="entryName">The name of the entry point in the DLL. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The method's calling convention. </param>
/// <param name="returnType">The method's return type. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <param name="nativeCallConv">The native calling convention. </param>
/// <param name="nativeCharSet">The method's native character set. </param>
/// <exception cref="T:System.ArgumentException">The method is not static or if the containing type is an interface or if the method is abstract of if the method was previously defined. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="dllName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /></exception>
// Token: 0x06001B70 RID: 7024 RVA: 0x00066D78 File Offset: 0x00064F78
public MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if ((attributes & MethodAttributes.Static) == MethodAttributes.PrivateScope)
{
throw new ArgumentException("global methods must be static");
}
if (this.global_type_created != null)
{
throw new InvalidOperationException("global methods already created");
}
this.CreateGlobalType();
MethodBuilder methodBuilder = this.global_type.DefinePInvokeMethod(name, dllName, entryName, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet);
this.addGlobalMethod(methodBuilder);
return methodBuilder;
}
/// <summary>Constructs a TypeBuilder for a type with the specified name.</summary>
/// <returns>Returns the created TypeBuilder.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B71 RID: 7025 RVA: 0x00066DEC File Offset: 0x00064FEC
public TypeBuilder DefineType(string name)
{
return this.DefineType(name, TypeAttributes.NotPublic);
}
/// <summary>Constructs a TypeBuilder given the type name and the type attributes.</summary>
/// <returns>Returns a TypeBuilder created with all of the requested attributes.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the defined type. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B72 RID: 7026 RVA: 0x00066DF8 File Offset: 0x00064FF8
public TypeBuilder DefineType(string name, TypeAttributes attr)
{
if ((attr & TypeAttributes.ClassSemanticsMask) != TypeAttributes.NotPublic)
{
return this.DefineType(name, attr, null, null);
}
return this.DefineType(name, attr, typeof(object), null);
}
/// <summary>Constructs a TypeBuilder given type name, its attributes, and the type that the defined type extends.</summary>
/// <returns>Returns a TypeBuilder created with all of the requested attributes.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attribute to be associated with the type. </param>
/// <param name="parent">The Type that the defined type extends. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B73 RID: 7027 RVA: 0x00066E2C File Offset: 0x0006502C
public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent)
{
return this.DefineType(name, attr, parent, null);
}
// Token: 0x06001B74 RID: 7028 RVA: 0x00066E38 File Offset: 0x00065038
private void AddType(TypeBuilder tb)
{
if (this.types != null)
{
if (this.types.Length == this.num_types)
{
TypeBuilder[] array = new TypeBuilder[this.types.Length * 2];
Array.Copy(this.types, array, this.num_types);
this.types = array;
}
}
else
{
this.types = new TypeBuilder[1];
}
this.types[this.num_types] = tb;
this.num_types++;
}
// Token: 0x06001B75 RID: 7029 RVA: 0x00066EBC File Offset: 0x000650BC
private TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packingSize, int typesize)
{
if (this.name_cache.ContainsKey(name))
{
throw new ArgumentException("Duplicate type name within an assembly.");
}
TypeBuilder typeBuilder = new TypeBuilder(this, name, attr, parent, interfaces, packingSize, typesize, null);
this.AddType(typeBuilder);
this.name_cache.Add(name, typeBuilder);
return typeBuilder;
}
// Token: 0x06001B76 RID: 7030 RVA: 0x00066F0C File Offset: 0x0006510C
internal void RegisterTypeName(TypeBuilder tb, string name)
{
this.name_cache.Add(name, tb);
}
// Token: 0x06001B77 RID: 7031 RVA: 0x00066F1C File Offset: 0x0006511C
internal TypeBuilder GetRegisteredType(string name)
{
return (TypeBuilder)this.name_cache[name];
}
/// <summary>Constructs a TypeBuilder given the type name, attributes, the type that the defined type extends, and the interfaces that the defined type implements.</summary>
/// <returns>Returns a TypeBuilder created with all of the requested attributes.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes to be associated with the type. </param>
/// <param name="parent">The type that the defined type extends. </param>
/// <param name="interfaces">The list of interfaces that the type implements. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B78 RID: 7032 RVA: 0x00066F30 File Offset: 0x00065130
[ComVisible(true)]
public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, Type[] interfaces)
{
return this.DefineType(name, attr, parent, interfaces, PackingSize.Unspecified, 0);
}
/// <summary>Constructs a TypeBuilder given the type name, the attributes, the type that the defined type extends, and the total size of the type.</summary>
/// <returns>Returns a TypeBuilder object.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the defined type. </param>
/// <param name="parent">The Type that the defined type extends. </param>
/// <param name="typesize">The total size of the type. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B79 RID: 7033 RVA: 0x00066F40 File Offset: 0x00065140
public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, int typesize)
{
return this.DefineType(name, attr, parent, null, PackingSize.Unspecified, 0);
}
/// <summary>Constructs a TypeBuilder given the type name, the attributes, the type that the defined type extends, and the packing size of the type.</summary>
/// <returns>Returns a TypeBuilder object.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the defined type. </param>
/// <param name="parent">The Type that the defined type extends. </param>
/// <param name="packsize">The packing size of the type. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B7A RID: 7034 RVA: 0x00066F50 File Offset: 0x00065150
public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, PackingSize packsize)
{
return this.DefineType(name, attr, parent, null, packsize, 0);
}
/// <summary>Constructs a TypeBuilder given the type name, attributes, the type that the defined type extends, the packing size of the defined type, and the total size of the defined type.</summary>
/// <returns>Returns a TypeBuilder created with all of the requested attributes.</returns>
/// <param name="name">The full path of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the defined type. </param>
/// <param name="parent">The type that the defined type extends. </param>
/// <param name="packingSize">The packing size of the type. </param>
/// <param name="typesize">The total size of the type. </param>
/// <exception cref="T:System.ArgumentException">A type with the given name exists in the parent assembly of this module.-or- Nested type attributes are set on a type that is not nested. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B7B RID: 7035 RVA: 0x00066F60 File Offset: 0x00065160
public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, PackingSize packingSize, int typesize)
{
return this.DefineType(name, attr, parent, null, packingSize, typesize);
}
/// <summary>Returns the named method on an array class.</summary>
/// <returns>The named method on an array class.</returns>
/// <param name="arrayClass">An array class. </param>
/// <param name="methodName">The name of a method on the array class. </param>
/// <param name="callingConvention">The method's calling convention. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="arrayClass" /> is not an array. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="arrayClass" /> or <paramref name="methodName" /> is null. </exception>
// Token: 0x06001B7C RID: 7036 RVA: 0x00066F70 File Offset: 0x00065170
public MethodInfo GetArrayMethod(Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
{
return new MonoArrayMethod(arrayClass, methodName, callingConvention, returnType, parameterTypes);
}
/// <summary>Defines an enumeration type that is a value type with a single non-static field called <paramref name="value__" /> of the specified type.</summary>
/// <returns>Returns the defined enumeration.</returns>
/// <param name="name">The full path of the enumeration type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="visibility">The type attributes for the enumeration. The attributes are any bits defined by <see cref="F:System.Reflection.TypeAttributes.VisibilityMask" />. </param>
/// <param name="underlyingType">The underlying type for the enumeration. This must be a built-in integer type. See .NET Framework Class Library Overview.</param>
/// <exception cref="T:System.ArgumentException">Attributes other than visibility attributes are provided.-or- An enum with the given name exists in the parent assembly of this module.-or- When the visibility attributes are incorrect for the scope of the enum. For example, if <see cref="F:System.Reflection.TypeAttributes.NestedPublic" /> is specified as the <paramref name="visibility" /> but the enum is not a nested type. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001B7D RID: 7037 RVA: 0x00066F80 File Offset: 0x00065180
public EnumBuilder DefineEnum(string name, TypeAttributes visibility, Type underlyingType)
{
if (this.name_cache.Contains(name))
{
throw new ArgumentException("Duplicate type name within an assembly.");
}
EnumBuilder enumBuilder = new EnumBuilder(this, name, visibility, underlyingType);
TypeBuilder typeBuilder = enumBuilder.GetTypeBuilder();
this.AddType(typeBuilder);
this.name_cache.Add(name, typeBuilder);
return enumBuilder;
}
/// <summary>Gets the named type defined in the module.</summary>
/// <returns>The requested type. Returns null if the type is not found.</returns>
/// <param name="className">The name of the <see cref="T:System.Type" /> to get. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="className" /> is zero or if length of <paramref name="className" /> is greater than 1023. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="className" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The requested <see cref="T:System.Type" /> is non-public and the caller does not have <see cref="T:System.Security.Permissions.ReflectionPermission" /> to reflect non-public objects outside the current assembly. </exception>
/// <exception cref="T:System.Reflection.TargetInvocationException">A class initializer is invoked and throws an exception. </exception>
/// <exception cref="T:System.TypeLoadException">An error is encountered while loading the <see cref="T:System.Type" />. </exception>
// Token: 0x06001B7E RID: 7038 RVA: 0x00066FD0 File Offset: 0x000651D0
[ComVisible(true)]
public override Type GetType(string className)
{
return this.GetType(className, false, false);
}
/// <summary>Gets the named type defined in the module optionally ignoring the case of the type name.</summary>
/// <returns>The requested type. Returns null if the type is not found.</returns>
/// <param name="className">The name of the <see cref="T:System.Type" /> to get. </param>
/// <param name="ignoreCase">If true, the search is case-insensitive. If false, the search is case-sensitive. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="className" /> is zero.-or- The length of <paramref name="className" /> is greater than 1023. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="className" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The requested <see cref="T:System.Type" /> is non-public and the caller does not have <see cref="T:System.Security.Permissions.ReflectionPermission" /> to reflect non-public objects outside the current assembly. </exception>
/// <exception cref="T:System.Reflection.TargetInvocationException">A class initializer is invoked and throws an exception. </exception>
// Token: 0x06001B7F RID: 7039 RVA: 0x00066FDC File Offset: 0x000651DC
[ComVisible(true)]
public override Type GetType(string className, bool ignoreCase)
{
return this.GetType(className, false, ignoreCase);
}
// Token: 0x06001B80 RID: 7040 RVA: 0x00066FE8 File Offset: 0x000651E8
private TypeBuilder search_in_array(TypeBuilder[] arr, int validElementsInArray, string className)
{
for (int i = 0; i < validElementsInArray; i++)
{
if (string.Compare(className, arr[i].FullName, true, CultureInfo.InvariantCulture) == 0)
{
return arr[i];
}
}
return null;
}
// Token: 0x06001B81 RID: 7041 RVA: 0x00067028 File Offset: 0x00065228
private TypeBuilder search_nested_in_array(TypeBuilder[] arr, int validElementsInArray, string className)
{
for (int i = 0; i < validElementsInArray; i++)
{
if (string.Compare(className, arr[i].Name, true, CultureInfo.InvariantCulture) == 0)
{
return arr[i];
}
}
return null;
}
// Token: 0x06001B82 RID: 7042
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern Type create_modified_type(TypeBuilder tb, string modifiers);
// Token: 0x06001B83 RID: 7043 RVA: 0x00067068 File Offset: 0x00065268
private TypeBuilder GetMaybeNested(TypeBuilder t, string className)
{
int num = className.IndexOf('+');
if (num >= 0)
{
if (t.subtypes != null)
{
string text = className.Substring(0, num);
string text2 = className.Substring(num + 1);
TypeBuilder typeBuilder = this.search_nested_in_array(t.subtypes, t.subtypes.Length, text);
if (typeBuilder != null)
{
return this.GetMaybeNested(typeBuilder, text2);
}
}
return null;
}
if (t.subtypes != null)
{
return this.search_nested_in_array(t.subtypes, t.subtypes.Length, className);
}
return null;
}
/// <summary>Gets the named type defined in the module optionally ignoring the case of the type name. Optionally throws an exception if the type is not found.</summary>
/// <returns>A <see cref="T:System.Type" /> object representing the specified type, if the type is declared in this module; otherwise, null.</returns>
/// <param name="className">The name of the <see cref="T:System.Type" /> to get. </param>
/// <param name="throwOnError">true to throw an exception if the type cannot be found; false to return null. </param>
/// <param name="ignoreCase">If true, the search is case-insensitive. If false, the search is case-sensitive. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="className" /> is zero.-or- The length of <paramref name="className" /> is greater than 1023. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="className" /> is null. </exception>
/// <exception cref="T:System.Security.SecurityException">The requested <see cref="T:System.Type" /> is non-public and the caller does not have <see cref="T:System.Security.Permissions.ReflectionPermission" /> to reflect non-public objects outside the current assembly. </exception>
/// <exception cref="T:System.Reflection.TargetInvocationException">A class initializer is invoked and throws an exception. </exception>
/// <exception cref="T:System.TypeLoadException">
/// <paramref name="throwOnError" /> is true and the specified type is not found. </exception>
// Token: 0x06001B84 RID: 7044 RVA: 0x000670EC File Offset: 0x000652EC
[ComVisible(true)]
public override Type GetType(string className, bool throwOnError, bool ignoreCase)
{
if (className == null)
{
throw new ArgumentNullException("className");
}
if (className.Length == 0)
{
throw new ArgumentException("className");
}
string text = className;
TypeBuilder typeBuilder = null;
if (this.types == null && throwOnError)
{
throw new TypeLoadException(className);
}
int num = className.IndexOfAny(ModuleBuilder.type_modifiers);
string text2;
if (num >= 0)
{
text2 = className.Substring(num);
className = className.Substring(0, num);
}
else
{
text2 = null;
}
if (!ignoreCase)
{
typeBuilder = this.name_cache[className] as TypeBuilder;
}
else
{
num = className.IndexOf('+');
if (num < 0)
{
if (this.types != null)
{
typeBuilder = this.search_in_array(this.types, this.num_types, className);
}
}
else
{
string text3 = className.Substring(0, num);
string text4 = className.Substring(num + 1);
typeBuilder = this.search_in_array(this.types, this.num_types, text3);
if (typeBuilder != null)
{
typeBuilder = this.GetMaybeNested(typeBuilder, text4);
}
}
}
if (typeBuilder == null && throwOnError)
{
throw new TypeLoadException(text);
}
if (typeBuilder != null && text2 != null)
{
Type type = ModuleBuilder.create_modified_type(typeBuilder, text2);
typeBuilder = type as TypeBuilder;
if (typeBuilder == null)
{
return type;
}
}
if (typeBuilder != null && typeBuilder.is_created)
{
return typeBuilder.CreateType();
}
return typeBuilder;
}
// Token: 0x06001B85 RID: 7045 RVA: 0x00067248 File Offset: 0x00065448
internal int get_next_table_index(object obj, int table, bool inc)
{
if (this.table_indexes == null)
{
this.table_indexes = new int[64];
for (int i = 0; i < 64; i++)
{
this.table_indexes[i] = 1;
}
this.table_indexes[2] = 2;
}
if (inc)
{
return this.table_indexes[table]++;
}
return this.table_indexes[table];
}
/// <summary>Set a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
// Token: 0x06001B86 RID: 7046 RVA: 0x000672B8 File Offset: 0x000654B8
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Set a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
// Token: 0x06001B87 RID: 7047 RVA: 0x0006731C File Offset: 0x0006551C
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Returns the symbol writer associated with this dynamic module.</summary>
/// <returns>Returns the symbol writer associated with this dynamic module.</returns>
// Token: 0x06001B88 RID: 7048 RVA: 0x0006732C File Offset: 0x0006552C
public ISymbolWriter GetSymWriter()
{
return this.symbolWriter;
}
/// <summary>Defines a document for source.</summary>
/// <returns>An ISymbolDocumentWriter object representing the defined document.</returns>
/// <param name="url">The URL for the document. </param>
/// <param name="language">The GUID that identifies the document language. This can be <see cref="F:System.Guid.Empty" />. </param>
/// <param name="languageVendor">The GUID that identifies the document language vendor. This can be <see cref="F:System.Guid.Empty" />. </param>
/// <param name="documentType">The GUID that identifies the document type. This can be <see cref="F:System.Guid.Empty" />. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="url" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">This method is called on a dynamic module that is not a debug module. </exception>
// Token: 0x06001B89 RID: 7049 RVA: 0x00067334 File Offset: 0x00065534
public ISymbolDocumentWriter DefineDocument(string url, Guid language, Guid languageVendor, Guid documentType)
{
if (this.symbolWriter != null)
{
return this.symbolWriter.DefineDocument(url, language, languageVendor, documentType);
}
return null;
}
/// <summary>Returns all the classes defined within this module.</summary>
/// <returns>An array of type Type containing classes defined within the module that is reflected by this instance.</returns>
/// <exception cref="T:System.Reflection.ReflectionTypeLoadException">One or more classes in a module could not be loaded. </exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
// Token: 0x06001B8A RID: 7050 RVA: 0x00067354 File Offset: 0x00065554
public override Type[] GetTypes()
{
if (this.types == null)
{
return Type.EmptyTypes;
}
int num = this.num_types;
Type[] array = new Type[num];
Array.Copy(this.types, array, num);
for (int i = 0; i < array.Length; i++)
{
if (this.types[i].is_created)
{
array[i] = this.types[i].CreateType();
}
}
return array;
}
/// <summary>Defines the named managed embedded resource with the given attributes that is to be stored in this module.</summary>
/// <returns>Returns a resource writer for the defined resource.</returns>
/// <param name="name">The name of the resource. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="description">The description of the resource. </param>
/// <param name="attribute">The resource attributes. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">This module is transient.-or- The containing assembly is not persistable. </exception>
// Token: 0x06001B8B RID: 7051 RVA: 0x000673C4 File Offset: 0x000655C4
public IResourceWriter DefineResource(string name, string description, ResourceAttributes attribute)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name == string.Empty)
{
throw new ArgumentException("name cannot be empty");
}
if (this.transient)
{
throw new InvalidOperationException("The module is transient");
}
if (!this.assemblyb.IsSave)
{
throw new InvalidOperationException("The assembly is transient");
}
ResourceWriter resourceWriter = new ResourceWriter(new MemoryStream());
if (this.resource_writers == null)
{
this.resource_writers = new Hashtable();
}
this.resource_writers[name] = resourceWriter;
if (this.resources != null)
{
MonoResource[] array = new MonoResource[this.resources.Length + 1];
Array.Copy(this.resources, array, this.resources.Length);
this.resources = array;
}
else
{
this.resources = new MonoResource[1];
}
int num = this.resources.Length - 1;
this.resources[num].name = name;
this.resources[num].attrs = attribute;
return resourceWriter;
}
/// <summary>Defines the named managed embedded resource to be stored in this module.</summary>
/// <returns>Returns a resource writer for the defined resource.</returns>
/// <param name="name">The name of the resource. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="description">The description of the resource. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">This module is transient.-or- The containing assembly is not persistable. </exception>
// Token: 0x06001B8C RID: 7052 RVA: 0x000674D4 File Offset: 0x000656D4
public IResourceWriter DefineResource(string name, string description)
{
return this.DefineResource(name, description, ResourceAttributes.Public);
}
/// <summary>Defines an unmanaged embedded resource given an opaque blob of bytes.</summary>
/// <param name="resource">An opaque blob that represents an unmanaged resource </param>
/// <exception cref="T:System.ArgumentException">An unmanaged resource has already been defined in the module's assembly. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="resource" /> is null. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001B8D RID: 7053 RVA: 0x000674E0 File Offset: 0x000656E0
[MonoTODO]
public void DefineUnmanagedResource(byte[] resource)
{
if (resource == null)
{
throw new ArgumentNullException("resource");
}
throw new NotImplementedException();
}
/// <summary>Defines an unmanaged resource given the name of Win32 resource file.</summary>
/// <param name="resourceFileName">The name of the unmanaged resource file </param>
/// <exception cref="T:System.ArgumentException">An unmanaged resource has already been defined in the module's assembly.-or- <paramref name="resourceFileName" /> is the empty string (""). </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="resourceFileName" /> is null. </exception>
/// <exception cref="T:System.IO.FileNotFoundException">
/// <paramref name="resourceFileName" /> is not found -or- <paramref name="resourceFileName" /> is a directory </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
/// </PermissionSet>
// Token: 0x06001B8E RID: 7054 RVA: 0x000674F8 File Offset: 0x000656F8
[MonoTODO]
public void DefineUnmanagedResource(string resourceFileName)
{
if (resourceFileName == null)
{
throw new ArgumentNullException("resourceFileName");
}
if (resourceFileName == string.Empty)
{
throw new ArgumentException("resourceFileName");
}
if (!File.Exists(resourceFileName) || Directory.Exists(resourceFileName))
{
throw new FileNotFoundException("File '" + resourceFileName + "' does not exists or is a directory.");
}
throw new NotImplementedException();
}
/// <summary>Defines a manifest resource blob to be embedded in the dynamic assembly.</summary>
/// <param name="name">The case-sensitive name for the resource.</param>
/// <param name="stream">A stream that contains the bytes for the resource.</param>
/// <param name="attribute">A <see cref="T:System.Reflection.ResourceAttributes" /> value that specifies whether the resource is public or private.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null.-or-<paramref name="stream" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> is a zero-length string.</exception>
/// <exception cref="T:System.InvalidOperationException">The dynamic assembly that contains the current module is transient; that is, no file name was specified when <see cref="M:System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(System.String,System.String)" /> was called.</exception>
// Token: 0x06001B8F RID: 7055 RVA: 0x00067564 File Offset: 0x00065764
public void DefineManifestResource(string name, Stream stream, ResourceAttributes attribute)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name == string.Empty)
{
throw new ArgumentException("name cannot be empty");
}
if (stream == null)
{
throw new ArgumentNullException("stream");
}
if (this.transient)
{
throw new InvalidOperationException("The module is transient");
}
if (!this.assemblyb.IsSave)
{
throw new InvalidOperationException("The assembly is transient");
}
if (this.resources != null)
{
MonoResource[] array = new MonoResource[this.resources.Length + 1];
Array.Copy(this.resources, array, this.resources.Length);
this.resources = array;
}
else
{
this.resources = new MonoResource[1];
}
int num = this.resources.Length - 1;
this.resources[num].name = name;
this.resources[num].attrs = attribute;
this.resources[num].stream = stream;
}
/// <summary>This method does nothing.</summary>
/// <param name="name">The name of the custom attribute </param>
/// <param name="data">An opaque blob of bytes that represents the value of the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="url" /> is null. </exception>
// Token: 0x06001B90 RID: 7056 RVA: 0x00067668 File Offset: 0x00065868
[MonoTODO]
public void SetSymCustomAttribute(string name, byte[] data)
{
throw new NotImplementedException();
}
/// <summary>Sets the user entry point.</summary>
/// <param name="entryPoint">The user entry point. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="entryPoint" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">This method is called on a dynamic module that is not a debug module.-or- <paramref name="entryPoint" /> is not contained in this dynamic module. </exception>
// Token: 0x06001B91 RID: 7057 RVA: 0x00067670 File Offset: 0x00065870
[MonoTODO]
public void SetUserEntryPoint(MethodInfo entryPoint)
{
if (entryPoint == null)
{
throw new ArgumentNullException("entryPoint");
}
if (entryPoint.DeclaringType.Module != this)
{
throw new InvalidOperationException("entryPoint is not contained in this module");
}
throw new NotImplementedException();
}
/// <summary>Returns the token used to identify the specified method within this module.</summary>
/// <returns>Returns the token used to identify the method represented by method within this module.</returns>
/// <param name="method">A MethodToken object representing the method to get a token for. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="method" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The declaring type for the method is not in this module. </exception>
// Token: 0x06001B92 RID: 7058 RVA: 0x000676B0 File Offset: 0x000658B0
public MethodToken GetMethodToken(MethodInfo method)
{
if (method == null)
{
throw new ArgumentNullException("method");
}
if (method.DeclaringType.Module != this)
{
throw new InvalidOperationException("The method is not in this module");
}
return new MethodToken(this.GetToken(method));
}
/// <summary>Returns the token for the named method on an array class.</summary>
/// <returns>The token for the named method on an array class.</returns>
/// <param name="arrayClass">The Type object for the array. </param>
/// <param name="methodName">A string containing the name of the method. </param>
/// <param name="callingConvention">The calling convention for the method. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="parameterTypes">The types of the parameters of the method. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="arrayClass" /> is not an array.-or- Length of <paramref name="methodName" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="arrayClass" /> or <paramref name="methodName" /> is null. </exception>
// Token: 0x06001B93 RID: 7059 RVA: 0x000676EC File Offset: 0x000658EC
public MethodToken GetArrayMethodToken(Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
{
return this.GetMethodToken(this.GetArrayMethod(arrayClass, methodName, callingConvention, returnType, parameterTypes));
}
/// <summary>Returns the token used to identify the specified constructor within this module.</summary>
/// <returns>Returns the token used to identify the constructor represented by <paramref name="con" /> within this module.</returns>
/// <param name="con">A ConstructorInfo object representing the constructor to get a token for. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
// Token: 0x06001B94 RID: 7060 RVA: 0x00067704 File Offset: 0x00065904
[ComVisible(true)]
public MethodToken GetConstructorToken(ConstructorInfo con)
{
if (con == null)
{
throw new ArgumentNullException("con");
}
return new MethodToken(this.GetToken(con));
}
/// <summary>Returns the token used to identify the specified field within this module.</summary>
/// <returns>Returns the token used to identify the field represented by <paramref name="con" /> within this module.</returns>
/// <param name="field">A FieldInfo object representing the field to get a token for. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
// Token: 0x06001B95 RID: 7061 RVA: 0x00067724 File Offset: 0x00065924
public FieldToken GetFieldToken(FieldInfo field)
{
if (field == null)
{
throw new ArgumentNullException("field");
}
if (field.DeclaringType.Module != this)
{
throw new InvalidOperationException("The method is not in this module");
}
return new FieldToken(this.GetToken(field));
}
/// <summary>Defines a signature token specified by the character array and signature length.</summary>
/// <returns>A SignatureToken for the defined signature.</returns>
/// <param name="sigBytes">The signature blob. </param>
/// <param name="sigLength">The length of the signature blob. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="sigBytes" /> is null. </exception>
// Token: 0x06001B96 RID: 7062 RVA: 0x00067760 File Offset: 0x00065960
[MonoTODO]
public SignatureToken GetSignatureToken(byte[] sigBytes, int sigLength)
{
throw new NotImplementedException();
}
/// <summary>Defines a signature token using the given SignatureHelper object.</summary>
/// <returns>A SignatureToken for the defined signature.</returns>
/// <param name="sigHelper">A reference to a SignatureHelper. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="sigHelper" /> is null. </exception>
// Token: 0x06001B97 RID: 7063 RVA: 0x00067768 File Offset: 0x00065968
public SignatureToken GetSignatureToken(SignatureHelper sigHelper)
{
if (sigHelper == null)
{
throw new ArgumentNullException("sigHelper");
}
return new SignatureToken(this.GetToken(sigHelper));
}
/// <summary>Returns the token of the given string in the modules constant pool.</summary>
/// <returns>Returns the StringToken of the string added to the constant pool.</returns>
/// <param name="str">The string to add to the module's constant pool. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="str" /> is null. </exception>
// Token: 0x06001B98 RID: 7064 RVA: 0x00067788 File Offset: 0x00065988
public StringToken GetStringConstant(string str)
{
if (str == null)
{
throw new ArgumentNullException("str");
}
return new StringToken(this.GetToken(str));
}
/// <summary>Returns the token used to identify the specified type within this module.</summary>
/// <returns>Returns the TypeToken used to identify the given type within this module.</returns>
/// <param name="type">The type object that represents the class type. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="type" /> is a ByRef type. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="type" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">A non-transient module that references a transient module. </exception>
// Token: 0x06001B99 RID: 7065 RVA: 0x000677A8 File Offset: 0x000659A8
public TypeToken GetTypeToken(Type type)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
if (type.IsByRef)
{
throw new ArgumentException("type can't be a byref type", "type");
}
if (!this.IsTransient() && type.Module is ModuleBuilder && ((ModuleBuilder)type.Module).IsTransient())
{
throw new InvalidOperationException("a non-transient module can't reference a transient module");
}
return new TypeToken(this.GetToken(type));
}
/// <summary>Returns the token used to identify the type given its name.</summary>
/// <returns>Returns the TypeToken used to identify the type given by name within this module.</returns>
/// <param name="name">A string representing the name of the class, including the namespace. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="name" /> is the empty string ("").-or-<paramref name="name" /> represents a ByRef type. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or-The type specified by <paramref name="name" /> could not be found.</exception>
/// <exception cref="T:System.InvalidOperationException">This is a non-transient module that references a transient module. </exception>
// Token: 0x06001B9A RID: 7066 RVA: 0x00067828 File Offset: 0x00065A28
public TypeToken GetTypeToken(string name)
{
return this.GetTypeToken(this.GetType(name));
}
// Token: 0x06001B9B RID: 7067
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int getUSIndex(ModuleBuilder mb, string str);
// Token: 0x06001B9C RID: 7068
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int getToken(ModuleBuilder mb, object obj);
// Token: 0x06001B9D RID: 7069
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern int getMethodToken(ModuleBuilder mb, MethodInfo method, Type[] opt_param_types);
// Token: 0x06001B9E RID: 7070 RVA: 0x00067838 File Offset: 0x00065A38
internal int GetToken(string str)
{
if (this.us_string_cache.Contains(str))
{
return (int)this.us_string_cache[str];
}
int usindex = ModuleBuilder.getUSIndex(this, str);
this.us_string_cache[str] = usindex;
return usindex;
}
// Token: 0x06001B9F RID: 7071 RVA: 0x00067884 File Offset: 0x00065A84
internal int GetToken(MemberInfo member)
{
return ModuleBuilder.getToken(this, member);
}
// Token: 0x06001BA0 RID: 7072 RVA: 0x00067890 File Offset: 0x00065A90
internal int GetToken(MethodInfo method, Type[] opt_param_types)
{
return ModuleBuilder.getMethodToken(this, method, opt_param_types);
}
// Token: 0x06001BA1 RID: 7073 RVA: 0x0006789C File Offset: 0x00065A9C
internal int GetToken(SignatureHelper helper)
{
return ModuleBuilder.getToken(this, helper);
}
// Token: 0x06001BA2 RID: 7074
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern void RegisterToken(object obj, int token);
// Token: 0x06001BA3 RID: 7075 RVA: 0x000678A8 File Offset: 0x00065AA8
internal TokenGenerator GetTokenGenerator()
{
if (this.token_gen == null)
{
this.token_gen = new ModuleBuilderTokenGenerator(this);
}
return this.token_gen;
}
// Token: 0x06001BA4 RID: 7076
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void build_metadata(ModuleBuilder mb);
// Token: 0x06001BA5 RID: 7077
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void WriteToFile(IntPtr handle);
// Token: 0x06001BA6 RID: 7078 RVA: 0x000678C8 File Offset: 0x00065AC8
internal void Save()
{
if (this.transient && !this.is_main)
{
return;
}
if (this.types != null)
{
for (int i = 0; i < this.num_types; i++)
{
if (!this.types[i].is_created)
{
throw new NotSupportedException("Type '" + this.types[i].FullName + "' was not completed.");
}
}
}
if (this.global_type != null && this.global_type_created == null)
{
this.global_type_created = this.global_type.CreateType();
}
if (this.resources != null)
{
for (int j = 0; j < this.resources.Length; j++)
{
IResourceWriter resourceWriter;
if (this.resource_writers != null && (resourceWriter = this.resource_writers[this.resources[j].name] as IResourceWriter) != null)
{
ResourceWriter resourceWriter2 = (ResourceWriter)resourceWriter;
resourceWriter2.Generate();
MemoryStream memoryStream = (MemoryStream)resourceWriter2.Stream;
this.resources[j].data = new byte[memoryStream.Length];
memoryStream.Seek(0L, SeekOrigin.Begin);
memoryStream.Read(this.resources[j].data, 0, (int)memoryStream.Length);
}
else
{
Stream stream = this.resources[j].stream;
if (stream != null)
{
try
{
long length = stream.Length;
this.resources[j].data = new byte[length];
stream.Seek(0L, SeekOrigin.Begin);
stream.Read(this.resources[j].data, 0, (int)length);
}
catch
{
}
}
}
}
}
ModuleBuilder.build_metadata(this);
string text = this.fqname;
if (this.assemblyb.AssemblyDir != null)
{
text = Path.Combine(this.assemblyb.AssemblyDir, text);
}
try
{
File.Delete(text);
}
catch
{
}
using (FileStream fileStream = new FileStream(text, FileMode.Create, FileAccess.Write))
{
this.WriteToFile(fileStream.Handle);
}
File.SetAttributes(text, (FileAttributes)(-2147483648));
if (this.types != null && this.symbolWriter != null)
{
for (int k = 0; k < this.num_types; k++)
{
this.types[k].GenerateDebugInfo(this.symbolWriter);
}
this.symbolWriter.Close();
}
}
// Token: 0x170004EA RID: 1258
// (get) Token: 0x06001BA7 RID: 7079 RVA: 0x00067BB4 File Offset: 0x00065DB4
internal string FileName
{
get
{
return this.fqname;
}
}
// Token: 0x170004EB RID: 1259
// (set) Token: 0x06001BA8 RID: 7080 RVA: 0x00067BBC File Offset: 0x00065DBC
internal bool IsMain
{
set
{
this.is_main = value;
}
}
// Token: 0x06001BA9 RID: 7081 RVA: 0x00067BC8 File Offset: 0x00065DC8
internal void CreateGlobalType()
{
if (this.global_type == null)
{
this.global_type = new TypeBuilder(this, TypeAttributes.NotPublic, 1);
}
}
// Token: 0x06001BAA RID: 7082 RVA: 0x00067BE4 File Offset: 0x00065DE4
internal override Guid GetModuleVersionId()
{
return new Guid(this.guid);
}
// Token: 0x06001BAB RID: 7083 RVA: 0x00067BF4 File Offset: 0x00065DF4
internal static Guid Mono_GetGuid(ModuleBuilder mb)
{
return mb.GetModuleVersionId();
}
// Token: 0x04000832 RID: 2098
private UIntPtr dynamic_image;
// Token: 0x04000833 RID: 2099
private int num_types;
// Token: 0x04000834 RID: 2100
private TypeBuilder[] types;
// Token: 0x04000835 RID: 2101
private CustomAttributeBuilder[] cattrs;
// Token: 0x04000836 RID: 2102
private byte[] guid;
// Token: 0x04000837 RID: 2103
private int table_idx;
// Token: 0x04000838 RID: 2104
internal AssemblyBuilder assemblyb;
// Token: 0x04000839 RID: 2105
private MethodBuilder[] global_methods;
// Token: 0x0400083A RID: 2106
private FieldBuilder[] global_fields;
// Token: 0x0400083B RID: 2107
private bool is_main;
// Token: 0x0400083C RID: 2108
private MonoResource[] resources;
// Token: 0x0400083D RID: 2109
private TypeBuilder global_type;
// Token: 0x0400083E RID: 2110
private Type global_type_created;
// Token: 0x0400083F RID: 2111
private Hashtable name_cache;
// Token: 0x04000840 RID: 2112
private Hashtable us_string_cache = new Hashtable();
// Token: 0x04000841 RID: 2113
private int[] table_indexes;
// Token: 0x04000842 RID: 2114
private bool transient;
// Token: 0x04000843 RID: 2115
private ModuleBuilderTokenGenerator token_gen;
// Token: 0x04000844 RID: 2116
private Hashtable resource_writers;
// Token: 0x04000845 RID: 2117
private ISymbolWriter symbolWriter;
// Token: 0x04000846 RID: 2118
private static readonly char[] type_modifiers = new char[] { '&', '[', '*' };
}
}
@@ -0,0 +1,41 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x02000208 RID: 520
internal class ModuleBuilderTokenGenerator : TokenGenerator
{
// Token: 0x06001BAC RID: 7084 RVA: 0x00067BFC File Offset: 0x00065DFC
public ModuleBuilderTokenGenerator(ModuleBuilder mb)
{
this.mb = mb;
}
// Token: 0x06001BAD RID: 7085 RVA: 0x00067C0C File Offset: 0x00065E0C
public int GetToken(string str)
{
return this.mb.GetToken(str);
}
// Token: 0x06001BAE RID: 7086 RVA: 0x00067C1C File Offset: 0x00065E1C
public int GetToken(MemberInfo member)
{
return this.mb.GetToken(member);
}
// Token: 0x06001BAF RID: 7087 RVA: 0x00067C2C File Offset: 0x00065E2C
public int GetToken(MethodInfo method, Type[] opt_param_types)
{
return this.mb.GetToken(method, opt_param_types);
}
// Token: 0x06001BB0 RID: 7088 RVA: 0x00067C3C File Offset: 0x00065E3C
public int GetToken(SignatureHelper helper)
{
return this.mb.GetToken(helper);
}
// Token: 0x04000847 RID: 2119
private ModuleBuilder mb;
}
}
@@ -0,0 +1,27 @@
using System;
using System.IO;
namespace System.Reflection.Emit
{
// Token: 0x020001DE RID: 478
internal struct MonoResource
{
// Token: 0x0400073B RID: 1851
public byte[] data;
// Token: 0x0400073C RID: 1852
public string name;
// Token: 0x0400073D RID: 1853
public string filename;
// Token: 0x0400073E RID: 1854
public ResourceAttributes attrs;
// Token: 0x0400073F RID: 1855
public int offset;
// Token: 0x04000740 RID: 1856
public Stream stream;
}
}
@@ -0,0 +1,29 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001DF RID: 479
internal struct MonoWin32Resource
{
// Token: 0x0600189A RID: 6298 RVA: 0x0005E2B8 File Offset: 0x0005C4B8
public MonoWin32Resource(int res_type, int res_id, int lang_id, byte[] data)
{
this.res_type = res_type;
this.res_id = res_id;
this.lang_id = lang_id;
this.data = data;
}
// Token: 0x04000741 RID: 1857
public int res_type;
// Token: 0x04000742 RID: 1858
public int res_id;
// Token: 0x04000743 RID: 1859
public int lang_id;
// Token: 0x04000744 RID: 1860
public byte[] data;
}
}
@@ -0,0 +1,17 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001DC RID: 476
internal enum NativeResourceType
{
// Token: 0x04000735 RID: 1845
None,
// Token: 0x04000736 RID: 1846
Unmanaged,
// Token: 0x04000737 RID: 1847
Assembly,
// Token: 0x04000738 RID: 1848
Explicit
}
}
+211
View File
@@ -0,0 +1,211 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes a Microsoft intermediate language (MSIL) instruction.</summary>
// Token: 0x0200020A RID: 522
[ComVisible(true)]
public struct OpCode
{
// Token: 0x06001BC1 RID: 7105 RVA: 0x00067DC0 File Offset: 0x00065FC0
internal OpCode(int p, int q)
{
this.op1 = (byte)(p & 255);
this.op2 = (byte)((p >> 8) & 255);
this.push = (byte)((p >> 16) & 255);
this.pop = (byte)((p >> 24) & 255);
this.size = (byte)(q & 255);
this.type = (byte)((q >> 8) & 255);
this.args = (byte)((q >> 16) & 255);
this.flow = (byte)((q >> 24) & 255);
}
/// <summary>Returns the generated hash code for this Opcode.</summary>
/// <returns>Returns the hash code for this instance.</returns>
// Token: 0x06001BC2 RID: 7106 RVA: 0x00067E50 File Offset: 0x00066050
public override int GetHashCode()
{
return this.Name.GetHashCode();
}
/// <summary>Tests whether the given object is equal to this Opcode.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of Opcode and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare to this object. </param>
// Token: 0x06001BC3 RID: 7107 RVA: 0x00067E60 File Offset: 0x00066060
public override bool Equals(object obj)
{
if (obj == null || !(obj is OpCode))
{
return false;
}
OpCode opCode = (OpCode)obj;
return opCode.op1 == this.op1 && opCode.op2 == this.op2;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.OpCode" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to the current instance.</param>
// Token: 0x06001BC4 RID: 7108 RVA: 0x00067EAC File Offset: 0x000660AC
public bool Equals(OpCode obj)
{
return obj.op1 == this.op1 && obj.op2 == this.op2;
}
/// <summary>Returns this Opcode as a <see cref="T:System.String" />.</summary>
/// <returns>Returns a <see cref="T:System.String" /> containing the name of this Opcode.</returns>
// Token: 0x06001BC5 RID: 7109 RVA: 0x00067EE0 File Offset: 0x000660E0
public override string ToString()
{
return this.Name;
}
/// <summary>The name of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The name of the MSIL instruction.</returns>
// Token: 0x170004F3 RID: 1267
// (get) Token: 0x06001BC6 RID: 7110 RVA: 0x00067EE8 File Offset: 0x000660E8
public string Name
{
get
{
if (this.op1 == 255)
{
return OpCodeNames.names[(int)this.op2];
}
return OpCodeNames.names[256 + (int)this.op2];
}
}
/// <summary>The size of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The size of the MSIL instruction.</returns>
// Token: 0x170004F4 RID: 1268
// (get) Token: 0x06001BC7 RID: 7111 RVA: 0x00067F1C File Offset: 0x0006611C
public int Size
{
get
{
return (int)this.size;
}
}
/// <summary>The type of Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The type of Microsoft intermediate language (MSIL) instruction.</returns>
// Token: 0x170004F5 RID: 1269
// (get) Token: 0x06001BC8 RID: 7112 RVA: 0x00067F24 File Offset: 0x00066124
public OpCodeType OpCodeType
{
get
{
return (OpCodeType)this.type;
}
}
/// <summary>The operand type of an Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The operand type of an MSIL instruction.</returns>
// Token: 0x170004F6 RID: 1270
// (get) Token: 0x06001BC9 RID: 7113 RVA: 0x00067F2C File Offset: 0x0006612C
public OperandType OperandType
{
get
{
return (OperandType)this.args;
}
}
/// <summary>The flow control characteristics of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The type of flow control.</returns>
// Token: 0x170004F7 RID: 1271
// (get) Token: 0x06001BCA RID: 7114 RVA: 0x00067F34 File Offset: 0x00066134
public FlowControl FlowControl
{
get
{
return (FlowControl)this.flow;
}
}
/// <summary>How the Microsoft intermediate language (MSIL) instruction pops the stack.</summary>
/// <returns>Read-only. The way the MSIL instruction pops the stack.</returns>
// Token: 0x170004F8 RID: 1272
// (get) Token: 0x06001BCB RID: 7115 RVA: 0x00067F3C File Offset: 0x0006613C
public StackBehaviour StackBehaviourPop
{
get
{
return (StackBehaviour)this.pop;
}
}
/// <summary>How the Microsoft intermediate language (MSIL) instruction pushes operand onto the stack.</summary>
/// <returns>Read-only. The way the MSIL instruction pushes operand onto the stack.</returns>
// Token: 0x170004F9 RID: 1273
// (get) Token: 0x06001BCC RID: 7116 RVA: 0x00067F44 File Offset: 0x00066144
public StackBehaviour StackBehaviourPush
{
get
{
return (StackBehaviour)this.push;
}
}
/// <summary>The value of the immediate operand of the Microsoft intermediate language (MSIL) instruction.</summary>
/// <returns>Read-only. The value of the immediate operand of the MSIL instruction.</returns>
// Token: 0x170004FA RID: 1274
// (get) Token: 0x06001BCD RID: 7117 RVA: 0x00067F4C File Offset: 0x0006614C
public short Value
{
get
{
if (this.size == 1)
{
return (short)this.op2;
}
return (short)(((int)this.op1 << 8) | (int)this.op2);
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.OpCode" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001BCE RID: 7118 RVA: 0x00067F74 File Offset: 0x00066174
public static bool operator ==(OpCode a, OpCode b)
{
return a.op1 == b.op1 && a.op2 == b.op2;
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.OpCode" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.OpCode" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001BCF RID: 7119 RVA: 0x00067FA8 File Offset: 0x000661A8
public static bool operator !=(OpCode a, OpCode b)
{
return a.op1 != b.op1 || a.op2 != b.op2;
}
// Token: 0x0400084F RID: 2127
internal byte op1;
// Token: 0x04000850 RID: 2128
internal byte op2;
// Token: 0x04000851 RID: 2129
private byte push;
// Token: 0x04000852 RID: 2130
private byte pop;
// Token: 0x04000853 RID: 2131
private byte size;
// Token: 0x04000854 RID: 2132
private byte type;
// Token: 0x04000855 RID: 2133
private byte args;
// Token: 0x04000856 RID: 2134
private byte flow;
}
}
@@ -0,0 +1,245 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x0200020B RID: 523
internal class OpCodeNames
{
// Token: 0x06001BD1 RID: 7121 RVA: 0x00067FDC File Offset: 0x000661DC
// Note: this type is marked as 'beforefieldinit'.
static OpCodeNames()
{
string[] array = new string[304];
array[0] = "nop";
array[1] = "break";
array[2] = "ldarg.0";
array[3] = "ldarg.1";
array[4] = "ldarg.2";
array[5] = "ldarg.3";
array[6] = "ldloc.0";
array[7] = "ldloc.1";
array[8] = "ldloc.2";
array[9] = "ldloc.3";
array[10] = "stloc.0";
array[11] = "stloc.1";
array[12] = "stloc.2";
array[13] = "stloc.3";
array[14] = "ldarg.s";
array[15] = "ldarga.s";
array[16] = "starg.s";
array[17] = "ldloc.s";
array[18] = "ldloca.s";
array[19] = "stloc.s";
array[20] = "ldnull";
array[21] = "ldc.i4.m1";
array[22] = "ldc.i4.0";
array[23] = "ldc.i4.1";
array[24] = "ldc.i4.2";
array[25] = "ldc.i4.3";
array[26] = "ldc.i4.4";
array[27] = "ldc.i4.5";
array[28] = "ldc.i4.6";
array[29] = "ldc.i4.7";
array[30] = "ldc.i4.8";
array[31] = "ldc.i4.s";
array[32] = "ldc.i4";
array[33] = "ldc.i8";
array[34] = "ldc.r4";
array[35] = "ldc.r8";
array[37] = "dup";
array[38] = "pop";
array[39] = "jmp";
array[40] = "call";
array[41] = "calli";
array[42] = "ret";
array[43] = "br.s";
array[44] = "brfalse.s";
array[45] = "brtrue.s";
array[46] = "beq.s";
array[47] = "bge.s";
array[48] = "bgt.s";
array[49] = "ble.s";
array[50] = "blt.s";
array[51] = "bne.un.s";
array[52] = "bge.un.s";
array[53] = "bgt.un.s";
array[54] = "ble.un.s";
array[55] = "blt.un.s";
array[56] = "br";
array[57] = "brfalse";
array[58] = "brtrue";
array[59] = "beq";
array[60] = "bge";
array[61] = "bgt";
array[62] = "ble";
array[63] = "blt";
array[64] = "bne.un";
array[65] = "bge.un";
array[66] = "bgt.un";
array[67] = "ble.un";
array[68] = "blt.un";
array[69] = "switch";
array[70] = "ldind.i1";
array[71] = "ldind.u1";
array[72] = "ldind.i2";
array[73] = "ldind.u2";
array[74] = "ldind.i4";
array[75] = "ldind.u4";
array[76] = "ldind.i8";
array[77] = "ldind.i";
array[78] = "ldind.r4";
array[79] = "ldind.r8";
array[80] = "ldind.ref";
array[81] = "stind.ref";
array[82] = "stind.i1";
array[83] = "stind.i2";
array[84] = "stind.i4";
array[85] = "stind.i8";
array[86] = "stind.r4";
array[87] = "stind.r8";
array[88] = "add";
array[89] = "sub";
array[90] = "mul";
array[91] = "div";
array[92] = "div.un";
array[93] = "rem";
array[94] = "rem.un";
array[95] = "and";
array[96] = "or";
array[97] = "xor";
array[98] = "shl";
array[99] = "shr";
array[100] = "shr.un";
array[101] = "neg";
array[102] = "not";
array[103] = "conv.i1";
array[104] = "conv.i2";
array[105] = "conv.i4";
array[106] = "conv.i8";
array[107] = "conv.r4";
array[108] = "conv.r8";
array[109] = "conv.u4";
array[110] = "conv.u8";
array[111] = "callvirt";
array[112] = "cpobj";
array[113] = "ldobj";
array[114] = "ldstr";
array[115] = "newobj";
array[116] = "castclass";
array[117] = "isinst";
array[118] = "conv.r.un";
array[121] = "unbox";
array[122] = "throw";
array[123] = "ldfld";
array[124] = "ldflda";
array[125] = "stfld";
array[126] = "ldsfld";
array[127] = "ldsflda";
array[128] = "stsfld";
array[129] = "stobj";
array[130] = "conv.ovf.i1.un";
array[131] = "conv.ovf.i2.un";
array[132] = "conv.ovf.i4.un";
array[133] = "conv.ovf.i8.un";
array[134] = "conv.ovf.u1.un";
array[135] = "conv.ovf.u2.un";
array[136] = "conv.ovf.u4.un";
array[137] = "conv.ovf.u8.un";
array[138] = "conv.ovf.i.un";
array[139] = "conv.ovf.u.un";
array[140] = "box";
array[141] = "newarr";
array[142] = "ldlen";
array[143] = "ldelema";
array[144] = "ldelem.i1";
array[145] = "ldelem.u1";
array[146] = "ldelem.i2";
array[147] = "ldelem.u2";
array[148] = "ldelem.i4";
array[149] = "ldelem.u4";
array[150] = "ldelem.i8";
array[151] = "ldelem.i";
array[152] = "ldelem.r4";
array[153] = "ldelem.r8";
array[154] = "ldelem.ref";
array[155] = "stelem.i";
array[156] = "stelem.i1";
array[157] = "stelem.i2";
array[158] = "stelem.i4";
array[159] = "stelem.i8";
array[160] = "stelem.r4";
array[161] = "stelem.r8";
array[162] = "stelem.ref";
array[163] = "ldelem";
array[164] = "stelem";
array[165] = "unbox.any";
array[179] = "conv.ovf.i1";
array[180] = "conv.ovf.u1";
array[181] = "conv.ovf.i2";
array[182] = "conv.ovf.u2";
array[183] = "conv.ovf.i4";
array[184] = "conv.ovf.u4";
array[185] = "conv.ovf.i8";
array[186] = "conv.ovf.u8";
array[194] = "refanyval";
array[195] = "ckfinite";
array[198] = "mkrefany";
array[208] = "ldtoken";
array[209] = "conv.u2";
array[210] = "conv.u1";
array[211] = "conv.i";
array[212] = "conv.ovf.i";
array[213] = "conv.ovf.u";
array[214] = "add.ovf";
array[215] = "add.ovf.un";
array[216] = "mul.ovf";
array[217] = "mul.ovf.un";
array[218] = "sub.ovf";
array[219] = "sub.ovf.un";
array[220] = "endfinally";
array[221] = "leave";
array[222] = "leave.s";
array[223] = "stind.i";
array[224] = "conv.u";
array[248] = "prefix7";
array[249] = "prefix6";
array[250] = "prefix5";
array[251] = "prefix4";
array[252] = "prefix3";
array[253] = "prefix2";
array[254] = "prefix1";
array[255] = "prefixref";
array[256] = "arglist";
array[257] = "ceq";
array[258] = "cgt";
array[259] = "cgt.un";
array[260] = "clt";
array[261] = "clt.un";
array[262] = "ldftn";
array[263] = "ldvirtftn";
array[265] = "ldarg";
array[266] = "ldarga";
array[267] = "starg";
array[268] = "ldloc";
array[269] = "ldloca";
array[270] = "stloc";
array[271] = "localloc";
array[273] = "endfilter";
array[274] = "unaligned.";
array[275] = "volatile.";
array[276] = "tail.";
array[277] = "initobj";
array[278] = "constrained.";
array[279] = "cpblk";
array[280] = "initblk";
array[282] = "rethrow";
array[284] = "sizeof";
array[285] = "refanytype";
array[286] = "readonly.";
OpCodeNames.names = array;
}
// Token: 0x04000857 RID: 2135
internal static readonly string[] names;
}
}
@@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes the types of the Microsoft intermediate language (MSIL) instructions.</summary>
// Token: 0x0200020C RID: 524
[ComVisible(true)]
[Serializable]
public enum OpCodeType
{
/// <summary>This enumerator value is reserved and should not be used.</summary>
// Token: 0x04000859 RID: 2137
[Obsolete("This API has been deprecated.")]
Annotation,
/// <summary>These are Microsoft intermediate language (MSIL) instructions that are used as a synonym for other MSIL instructions. For example, ldarg.0 represents the ldarg instruction with an argument of 0.</summary>
// Token: 0x0400085A RID: 2138
Macro,
/// <summary>Describes a reserved Microsoft intermediate language (MSIL) instruction.</summary>
// Token: 0x0400085B RID: 2139
Nternal,
/// <summary>Describes a Microsoft intermediate language (MSIL) instruction that applies to objects.</summary>
// Token: 0x0400085C RID: 2140
Objmodel,
/// <summary>Describes a prefix instruction that modifies the behavior of the following instruction.</summary>
// Token: 0x0400085D RID: 2141
Prefix,
/// <summary>Describes a built-in instruction.</summary>
// Token: 0x0400085E RID: 2142
Primitive
}
}
+931
View File
@@ -0,0 +1,931 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Provides field representations of the Microsoft Intermediate Language (MSIL) instructions for emission by the <see cref="T:System.Reflection.Emit.ILGenerator" /> class members (such as <see cref="M:System.Reflection.Emit.ILGenerator.Emit(System.Reflection.Emit.OpCode)" />).</summary>
// Token: 0x0200020D RID: 525
[ComVisible(true)]
public class OpCodes
{
// Token: 0x06001BD2 RID: 7122 RVA: 0x00068910 File Offset: 0x00066B10
internal OpCodes()
{
}
/// <summary>Returns true or false if the supplied opcode takes a single byte argument.</summary>
/// <returns>True or false.</returns>
/// <param name="inst">An instance of an Opcode object. </param>
// Token: 0x06001BD4 RID: 7124 RVA: 0x00069AD0 File Offset: 0x00067CD0
public static bool TakesSingleByteArgument(OpCode inst)
{
OperandType operandType = inst.OperandType;
return operandType == OperandType.ShortInlineBrTarget || operandType == OperandType.ShortInlineI || operandType == OperandType.ShortInlineR || operandType == OperandType.ShortInlineVar;
}
/// <summary>Fills space if opcodes are patched. No meaningful operation is performed although a processing cycle can be consumed.</summary>
// Token: 0x0400085F RID: 2143
public static readonly OpCode Nop = new OpCode(1179903, 84215041);
/// <summary>Signals the Common Language Infrastructure (CLI) to inform the debugger that a break point has been tripped.</summary>
// Token: 0x04000860 RID: 2144
public static readonly OpCode Break = new OpCode(1180159, 17106177);
/// <summary>Loads the argument at index 0 onto the evaluation stack.</summary>
// Token: 0x04000861 RID: 2145
public static readonly OpCode Ldarg_0 = new OpCode(1245951, 84214017);
/// <summary>Loads the argument at index 1 onto the evaluation stack.</summary>
// Token: 0x04000862 RID: 2146
public static readonly OpCode Ldarg_1 = new OpCode(1246207, 84214017);
/// <summary>Loads the argument at index 2 onto the evaluation stack.</summary>
// Token: 0x04000863 RID: 2147
public static readonly OpCode Ldarg_2 = new OpCode(1246463, 84214017);
/// <summary>Loads the argument at index 3 onto the evaluation stack.</summary>
// Token: 0x04000864 RID: 2148
public static readonly OpCode Ldarg_3 = new OpCode(1246719, 84214017);
/// <summary>Loads the local variable at index 0 onto the evaluation stack.</summary>
// Token: 0x04000865 RID: 2149
public static readonly OpCode Ldloc_0 = new OpCode(1246975, 84214017);
/// <summary>Loads the local variable at index 1 onto the evaluation stack.</summary>
// Token: 0x04000866 RID: 2150
public static readonly OpCode Ldloc_1 = new OpCode(1247231, 84214017);
/// <summary>Loads the local variable at index 2 onto the evaluation stack.</summary>
// Token: 0x04000867 RID: 2151
public static readonly OpCode Ldloc_2 = new OpCode(1247487, 84214017);
/// <summary>Loads the local variable at index 3 onto the evaluation stack.</summary>
// Token: 0x04000868 RID: 2152
public static readonly OpCode Ldloc_3 = new OpCode(1247743, 84214017);
/// <summary>Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 0.</summary>
// Token: 0x04000869 RID: 2153
public static readonly OpCode Stloc_0 = new OpCode(17959679, 84214017);
/// <summary>Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 1.</summary>
// Token: 0x0400086A RID: 2154
public static readonly OpCode Stloc_1 = new OpCode(17959935, 84214017);
/// <summary>Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 2.</summary>
// Token: 0x0400086B RID: 2155
public static readonly OpCode Stloc_2 = new OpCode(17960191, 84214017);
/// <summary>Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 3.</summary>
// Token: 0x0400086C RID: 2156
public static readonly OpCode Stloc_3 = new OpCode(17960447, 84214017);
/// <summary>Loads the argument (referenced by a specified short form index) onto the evaluation stack.</summary>
// Token: 0x0400086D RID: 2157
public static readonly OpCode Ldarg_S = new OpCode(1249023, 85065985);
/// <summary>Load an argument address, in short form, onto the evaluation stack.</summary>
// Token: 0x0400086E RID: 2158
public static readonly OpCode Ldarga_S = new OpCode(1380351, 85065985);
/// <summary>Stores the value on top of the evaluation stack in the argument slot at a specified index, short form.</summary>
// Token: 0x0400086F RID: 2159
public static readonly OpCode Starg_S = new OpCode(17961215, 85065985);
/// <summary>Loads the local variable at a specific index onto the evaluation stack, short form.</summary>
// Token: 0x04000870 RID: 2160
public static readonly OpCode Ldloc_S = new OpCode(1249791, 85065985);
/// <summary>Loads the address of the local variable at a specific index onto the evaluation stack, short form.</summary>
// Token: 0x04000871 RID: 2161
public static readonly OpCode Ldloca_S = new OpCode(1381119, 85065985);
/// <summary>Pops the current value from the top of the evaluation stack and stores it in a the local variable list at <paramref name="index" /> (short form).</summary>
// Token: 0x04000872 RID: 2162
public static readonly OpCode Stloc_S = new OpCode(17961983, 85065985);
/// <summary>Pushes a null reference (type O) onto the evaluation stack.</summary>
// Token: 0x04000873 RID: 2163
public static readonly OpCode Ldnull = new OpCode(1643775, 84215041);
/// <summary>Pushes the integer value of -1 onto the evaluation stack as an int32.</summary>
// Token: 0x04000874 RID: 2164
public static readonly OpCode Ldc_I4_M1 = new OpCode(1381887, 84214017);
/// <summary>Pushes the integer value of 0 onto the evaluation stack as an int32.</summary>
// Token: 0x04000875 RID: 2165
public static readonly OpCode Ldc_I4_0 = new OpCode(1382143, 84214017);
/// <summary>Pushes the integer value of 1 onto the evaluation stack as an int32.</summary>
// Token: 0x04000876 RID: 2166
public static readonly OpCode Ldc_I4_1 = new OpCode(1382399, 84214017);
/// <summary>Pushes the integer value of 2 onto the evaluation stack as an int32.</summary>
// Token: 0x04000877 RID: 2167
public static readonly OpCode Ldc_I4_2 = new OpCode(1382655, 84214017);
/// <summary>Pushes the integer value of 3 onto the evaluation stack as an int32.</summary>
// Token: 0x04000878 RID: 2168
public static readonly OpCode Ldc_I4_3 = new OpCode(1382911, 84214017);
/// <summary>Pushes the integer value of 4 onto the evaluation stack as an int32.</summary>
// Token: 0x04000879 RID: 2169
public static readonly OpCode Ldc_I4_4 = new OpCode(1383167, 84214017);
/// <summary>Pushes the integer value of 5 onto the evaluation stack as an int32.</summary>
// Token: 0x0400087A RID: 2170
public static readonly OpCode Ldc_I4_5 = new OpCode(1383423, 84214017);
/// <summary>Pushes the integer value of 6 onto the evaluation stack as an int32.</summary>
// Token: 0x0400087B RID: 2171
public static readonly OpCode Ldc_I4_6 = new OpCode(1383679, 84214017);
/// <summary>Pushes the integer value of 7 onto the evaluation stack as an int32.</summary>
// Token: 0x0400087C RID: 2172
public static readonly OpCode Ldc_I4_7 = new OpCode(1383935, 84214017);
/// <summary>Pushes the integer value of 8 onto the evaluation stack as an int32.</summary>
// Token: 0x0400087D RID: 2173
public static readonly OpCode Ldc_I4_8 = new OpCode(1384191, 84214017);
/// <summary>Pushes the supplied int8 value onto the evaluation stack as an int32, short form.</summary>
// Token: 0x0400087E RID: 2174
public static readonly OpCode Ldc_I4_S = new OpCode(1384447, 84934913);
/// <summary>Pushes a supplied value of type int32 onto the evaluation stack as an int32.</summary>
// Token: 0x0400087F RID: 2175
public static readonly OpCode Ldc_I4 = new OpCode(1384703, 84018433);
/// <summary>Pushes a supplied value of type int64 onto the evaluation stack as an int64.</summary>
// Token: 0x04000880 RID: 2176
public static readonly OpCode Ldc_I8 = new OpCode(1450495, 84083969);
/// <summary>Pushes a supplied value of type float32 onto the evaluation stack as type F (float).</summary>
// Token: 0x04000881 RID: 2177
public static readonly OpCode Ldc_R4 = new OpCode(1516287, 85001473);
/// <summary>Pushes a supplied value of type float64 onto the evaluation stack as type F (float).</summary>
// Token: 0x04000882 RID: 2178
public static readonly OpCode Ldc_R8 = new OpCode(1582079, 84346113);
/// <summary>Copies the current topmost value on the evaluation stack, and then pushes the copy onto the evaluation stack.</summary>
// Token: 0x04000883 RID: 2179
public static readonly OpCode Dup = new OpCode(18097663, 84215041);
/// <summary>Removes the value currently on top of the evaluation stack.</summary>
// Token: 0x04000884 RID: 2180
public static readonly OpCode Pop = new OpCode(17966847, 84215041);
/// <summary>Exits current method and jumps to specified method.</summary>
// Token: 0x04000885 RID: 2181
public static readonly OpCode Jmp = new OpCode(1189887, 33817857);
/// <summary>Calls the method indicated by the passed method descriptor.</summary>
// Token: 0x04000886 RID: 2182
public static readonly OpCode Call = new OpCode(437987583, 33817857);
/// <summary>Calls the method indicated on the evaluation stack (as a pointer to an entry point) with arguments described by a calling convention.</summary>
// Token: 0x04000887 RID: 2183
public static readonly OpCode Calli = new OpCode(437987839, 34145537);
/// <summary>Returns from the current method, pushing a return value (if present) from the callee's evaluation stack onto the caller's evaluation stack.</summary>
// Token: 0x04000888 RID: 2184
public static readonly OpCode Ret = new OpCode(437398271, 117769473);
/// <summary>Unconditionally transfers control to a target instruction (short form).</summary>
// Token: 0x04000889 RID: 2185
public static readonly OpCode Br_S = new OpCode(1190911, 983297);
/// <summary>Transfers control to a target instruction if <paramref name="value" /> is false, a null reference, or zero.</summary>
// Token: 0x0400088A RID: 2186
public static readonly OpCode Brfalse_S = new OpCode(51522815, 51314945);
/// <summary>Transfers control to a target instruction (short form) if <paramref name="value" /> is true, not null, or non-zero.</summary>
// Token: 0x0400088B RID: 2187
public static readonly OpCode Brtrue_S = new OpCode(51523071, 51314945);
/// <summary>Transfers control to a target instruction (short form) if two values are equal.</summary>
// Token: 0x0400088C RID: 2188
public static readonly OpCode Beq_S = new OpCode(34746111, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is greater than or equal to the second value.</summary>
// Token: 0x0400088D RID: 2189
public static readonly OpCode Bge_S = new OpCode(34746367, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is greater than the second value.</summary>
// Token: 0x0400088E RID: 2190
public static readonly OpCode Bgt_S = new OpCode(34746623, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is less than or equal to the second value.</summary>
// Token: 0x0400088F RID: 2191
public static readonly OpCode Ble_S = new OpCode(34746879, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is less than the second value.</summary>
// Token: 0x04000890 RID: 2192
public static readonly OpCode Blt_S = new OpCode(34747135, 51314945);
/// <summary>Transfers control to a target instruction (short form) when two unsigned integer values or unordered float values are not equal.</summary>
// Token: 0x04000891 RID: 2193
public static readonly OpCode Bne_Un_S = new OpCode(34747391, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x04000892 RID: 2194
public static readonly OpCode Bge_Un_S = new OpCode(34747647, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x04000893 RID: 2195
public static readonly OpCode Bgt_Un_S = new OpCode(34747903, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x04000894 RID: 2196
public static readonly OpCode Ble_Un_S = new OpCode(34748159, 51314945);
/// <summary>Transfers control to a target instruction (short form) if the first value is less than the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x04000895 RID: 2197
public static readonly OpCode Blt_Un_S = new OpCode(34748415, 51314945);
/// <summary>Unconditionally transfers control to a target instruction.</summary>
// Token: 0x04000896 RID: 2198
public static readonly OpCode Br = new OpCode(1194239, 1281);
/// <summary>Transfers control to a target instruction if <paramref name="value" /> is false, a null reference (Nothing in Visual Basic), or zero.</summary>
// Token: 0x04000897 RID: 2199
public static readonly OpCode Brfalse = new OpCode(51526143, 50332929);
/// <summary>Transfers control to a target instruction if <paramref name="value" /> is true, not null, or non-zero.</summary>
// Token: 0x04000898 RID: 2200
public static readonly OpCode Brtrue = new OpCode(51526399, 50332929);
/// <summary>Transfers control to a target instruction if two values are equal.</summary>
// Token: 0x04000899 RID: 2201
public static readonly OpCode Beq = new OpCode(34749439, 50331905);
/// <summary>Transfers control to a target instruction if the first value is greater than or equal to the second value.</summary>
// Token: 0x0400089A RID: 2202
public static readonly OpCode Bge = new OpCode(34749695, 50331905);
/// <summary>Transfers control to a target instruction if the first value is greater than the second value.</summary>
// Token: 0x0400089B RID: 2203
public static readonly OpCode Bgt = new OpCode(34749951, 50331905);
/// <summary>Transfers control to a target instruction if the first value is less than or equal to the second value.</summary>
// Token: 0x0400089C RID: 2204
public static readonly OpCode Ble = new OpCode(34750207, 50331905);
/// <summary>Transfers control to a target instruction if the first value is less than the second value.</summary>
// Token: 0x0400089D RID: 2205
public static readonly OpCode Blt = new OpCode(34750463, 50331905);
/// <summary>Transfers control to a target instruction when two unsigned integer values or unordered float values are not equal.</summary>
// Token: 0x0400089E RID: 2206
public static readonly OpCode Bne_Un = new OpCode(34750719, 50331905);
/// <summary>Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x0400089F RID: 2207
public static readonly OpCode Bge_Un = new OpCode(34750975, 50331905);
/// <summary>Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x040008A0 RID: 2208
public static readonly OpCode Bgt_Un = new OpCode(34751231, 50331905);
/// <summary>Transfers control to a target instruction if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x040008A1 RID: 2209
public static readonly OpCode Ble_Un = new OpCode(34751487, 50331905);
/// <summary>Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values.</summary>
// Token: 0x040008A2 RID: 2210
public static readonly OpCode Blt_Un = new OpCode(34751743, 50331905);
/// <summary>Implements a jump table.</summary>
// Token: 0x040008A3 RID: 2211
public static readonly OpCode Switch = new OpCode(51529215, 51053825);
/// <summary>Loads a value of type int8 as an int32 onto the evaluation stack indirectly.</summary>
// Token: 0x040008A4 RID: 2212
public static readonly OpCode Ldind_I1 = new OpCode(51726079, 84215041);
/// <summary>Loads a value of type unsigned int8 as an int32 onto the evaluation stack indirectly.</summary>
// Token: 0x040008A5 RID: 2213
public static readonly OpCode Ldind_U1 = new OpCode(51726335, 84215041);
/// <summary>Loads a value of type int16 as an int32 onto the evaluation stack indirectly.</summary>
// Token: 0x040008A6 RID: 2214
public static readonly OpCode Ldind_I2 = new OpCode(51726591, 84215041);
/// <summary>Loads a value of type unsigned int16 as an int32 onto the evaluation stack indirectly.</summary>
// Token: 0x040008A7 RID: 2215
public static readonly OpCode Ldind_U2 = new OpCode(51726847, 84215041);
/// <summary>Loads a value of type int32 as an int32 onto the evaluation stack indirectly.</summary>
// Token: 0x040008A8 RID: 2216
public static readonly OpCode Ldind_I4 = new OpCode(51727103, 84215041);
/// <summary>Loads a value of type unsigned int32 as an int32 onto the evaluation stack indirectly.</summary>
// Token: 0x040008A9 RID: 2217
public static readonly OpCode Ldind_U4 = new OpCode(51727359, 84215041);
/// <summary>Loads a value of type int64 as an int64 onto the evaluation stack indirectly.</summary>
// Token: 0x040008AA RID: 2218
public static readonly OpCode Ldind_I8 = new OpCode(51793151, 84215041);
/// <summary>Loads a value of type native int as a native int onto the evaluation stack indirectly.</summary>
// Token: 0x040008AB RID: 2219
public static readonly OpCode Ldind_I = new OpCode(51727871, 84215041);
/// <summary>Loads a value of type float32 as a type F (float) onto the evaluation stack indirectly.</summary>
// Token: 0x040008AC RID: 2220
public static readonly OpCode Ldind_R4 = new OpCode(51859199, 84215041);
/// <summary>Loads a value of type float64 as a type F (float) onto the evaluation stack indirectly.</summary>
// Token: 0x040008AD RID: 2221
public static readonly OpCode Ldind_R8 = new OpCode(51924991, 84215041);
/// <summary>Loads an object reference as a type O (object reference) onto the evaluation stack indirectly.</summary>
// Token: 0x040008AE RID: 2222
public static readonly OpCode Ldind_Ref = new OpCode(51990783, 84215041);
/// <summary>Stores a object reference value at a supplied address.</summary>
// Token: 0x040008AF RID: 2223
public static readonly OpCode Stind_Ref = new OpCode(85086719, 84215041);
/// <summary>Stores a value of type int8 at a supplied address.</summary>
// Token: 0x040008B0 RID: 2224
public static readonly OpCode Stind_I1 = new OpCode(85086975, 84215041);
/// <summary>Stores a value of type int16 at a supplied address.</summary>
// Token: 0x040008B1 RID: 2225
public static readonly OpCode Stind_I2 = new OpCode(85087231, 84215041);
/// <summary>Stores a value of type int32 at a supplied address.</summary>
// Token: 0x040008B2 RID: 2226
public static readonly OpCode Stind_I4 = new OpCode(85087487, 84215041);
/// <summary>Stores a value of type int64 at a supplied address.</summary>
// Token: 0x040008B3 RID: 2227
public static readonly OpCode Stind_I8 = new OpCode(101864959, 84215041);
/// <summary>Stores a value of type float32 at a supplied address.</summary>
// Token: 0x040008B4 RID: 2228
public static readonly OpCode Stind_R4 = new OpCode(135419647, 84215041);
/// <summary>Stores a value of type float64 at a supplied address.</summary>
// Token: 0x040008B5 RID: 2229
public static readonly OpCode Stind_R8 = new OpCode(152197119, 84215041);
/// <summary>Adds two values and pushes the result onto the evaluation stack.</summary>
// Token: 0x040008B6 RID: 2230
public static readonly OpCode Add = new OpCode(34822399, 84215041);
/// <summary>Subtracts one value from another and pushes the result onto the evaluation stack.</summary>
// Token: 0x040008B7 RID: 2231
public static readonly OpCode Sub = new OpCode(34822655, 84215041);
/// <summary>Multiplies two values and pushes the result on the evaluation stack.</summary>
// Token: 0x040008B8 RID: 2232
public static readonly OpCode Mul = new OpCode(34822911, 84215041);
/// <summary>Divides two values and pushes the result as a floating-point (type F) or quotient (type int32) onto the evaluation stack.</summary>
// Token: 0x040008B9 RID: 2233
public static readonly OpCode Div = new OpCode(34823167, 84215041);
/// <summary>Divides two unsigned integer values and pushes the result (int32) onto the evaluation stack.</summary>
// Token: 0x040008BA RID: 2234
public static readonly OpCode Div_Un = new OpCode(34823423, 84215041);
/// <summary>Divides two values and pushes the remainder onto the evaluation stack.</summary>
// Token: 0x040008BB RID: 2235
public static readonly OpCode Rem = new OpCode(34823679, 84215041);
/// <summary>Divides two unsigned values and pushes the remainder onto the evaluation stack.</summary>
// Token: 0x040008BC RID: 2236
public static readonly OpCode Rem_Un = new OpCode(34823935, 84215041);
/// <summary>Computes the bitwise AND of two values and pushes the result onto the evaluation stack.</summary>
// Token: 0x040008BD RID: 2237
public static readonly OpCode And = new OpCode(34824191, 84215041);
/// <summary>Compute the bitwise complement of the two integer values on top of the stack and pushes the result onto the evaluation stack.</summary>
// Token: 0x040008BE RID: 2238
public static readonly OpCode Or = new OpCode(34824447, 84215041);
/// <summary>Computes the bitwise XOR of the top two values on the evaluation stack, pushing the result onto the evaluation stack.</summary>
// Token: 0x040008BF RID: 2239
public static readonly OpCode Xor = new OpCode(34824703, 84215041);
/// <summary>Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack.</summary>
// Token: 0x040008C0 RID: 2240
public static readonly OpCode Shl = new OpCode(34824959, 84215041);
/// <summary>Shifts an integer value (in sign) to the right by a specified number of bits, pushing the result onto the evaluation stack.</summary>
// Token: 0x040008C1 RID: 2241
public static readonly OpCode Shr = new OpCode(34825215, 84215041);
/// <summary>Shifts an unsigned integer value (in zeroes) to the right by a specified number of bits, pushing the result onto the evaluation stack.</summary>
// Token: 0x040008C2 RID: 2242
public static readonly OpCode Shr_Un = new OpCode(34825471, 84215041);
/// <summary>Negates a value and pushes the result onto the evaluation stack.</summary>
// Token: 0x040008C3 RID: 2243
public static readonly OpCode Neg = new OpCode(18048511, 84215041);
/// <summary>Computes the bitwise complement of the integer value on top of the stack and pushes the result onto the evaluation stack as the same type.</summary>
// Token: 0x040008C4 RID: 2244
public static readonly OpCode Not = new OpCode(18048767, 84215041);
/// <summary>Converts the value on top of the evaluation stack to int8, then extends (pads) it to int32.</summary>
// Token: 0x040008C5 RID: 2245
public static readonly OpCode Conv_I1 = new OpCode(18180095, 84215041);
/// <summary>Converts the value on top of the evaluation stack to int16, then extends (pads) it to int32.</summary>
// Token: 0x040008C6 RID: 2246
public static readonly OpCode Conv_I2 = new OpCode(18180351, 84215041);
/// <summary>Converts the value on top of the evaluation stack to int32.</summary>
// Token: 0x040008C7 RID: 2247
public static readonly OpCode Conv_I4 = new OpCode(18180607, 84215041);
/// <summary>Converts the value on top of the evaluation stack to int64.</summary>
// Token: 0x040008C8 RID: 2248
public static readonly OpCode Conv_I8 = new OpCode(18246399, 84215041);
/// <summary>Converts the value on top of the evaluation stack to float32.</summary>
// Token: 0x040008C9 RID: 2249
public static readonly OpCode Conv_R4 = new OpCode(18312191, 84215041);
/// <summary>Converts the value on top of the evaluation stack to float64.</summary>
// Token: 0x040008CA RID: 2250
public static readonly OpCode Conv_R8 = new OpCode(18377983, 84215041);
/// <summary>Converts the value on top of the evaluation stack to unsigned int32, and extends it to int32.</summary>
// Token: 0x040008CB RID: 2251
public static readonly OpCode Conv_U4 = new OpCode(18181631, 84215041);
/// <summary>Converts the value on top of the evaluation stack to unsigned int64, and extends it to int64.</summary>
// Token: 0x040008CC RID: 2252
public static readonly OpCode Conv_U8 = new OpCode(18247423, 84215041);
/// <summary>Calls a late-bound method on an object, pushing the return value onto the evaluation stack.</summary>
// Token: 0x040008CD RID: 2253
public static readonly OpCode Callvirt = new OpCode(438005759, 33817345);
/// <summary>Copies the value type located at the address of an object (type &amp;, * or native int) to the address of the destination object (type &amp;, * or native int).</summary>
// Token: 0x040008CE RID: 2254
public static readonly OpCode Cpobj = new OpCode(85094655, 84738817);
/// <summary>Copies the value type object pointed to by an address to the top of the evaluation stack.</summary>
// Token: 0x040008CF RID: 2255
public static readonly OpCode Ldobj = new OpCode(51606015, 84738817);
/// <summary>Pushes a new object reference to a string literal stored in the metadata.</summary>
// Token: 0x040008D0 RID: 2256
public static readonly OpCode Ldstr = new OpCode(1667839, 84542209);
/// <summary>Creates a new object or a new instance of a value type, pushing an object reference (type O) onto the evaluation stack.</summary>
// Token: 0x040008D1 RID: 2257
public static readonly OpCode Newobj = new OpCode(437875711, 33817345);
/// <summary>Attempts to cast an object passed by reference to the specified class.</summary>
// Token: 0x040008D2 RID: 2258
[ComVisible(true)]
public static readonly OpCode Castclass = new OpCode(169440511, 84738817);
/// <summary>Tests whether an object reference (type O) is an instance of a particular class.</summary>
// Token: 0x040008D3 RID: 2259
public static readonly OpCode Isinst = new OpCode(169178623, 84738817);
/// <summary>Converts the unsigned integer value on top of the evaluation stack to float32.</summary>
// Token: 0x040008D4 RID: 2260
public static readonly OpCode Conv_R_Un = new OpCode(18380543, 84215041);
/// <summary>Converts the boxed representation of a value type to its unboxed form.</summary>
// Token: 0x040008D5 RID: 2261
public static readonly OpCode Unbox = new OpCode(169179647, 84739329);
/// <summary>Throws the exception object currently on the evaluation stack.</summary>
// Token: 0x040008D6 RID: 2262
public static readonly OpCode Throw = new OpCode(168983295, 134546177);
/// <summary>Finds the value of a field in the object whose reference is currently on the evaluation stack.</summary>
// Token: 0x040008D7 RID: 2263
public static readonly OpCode Ldfld = new OpCode(169049087, 83952385);
/// <summary>Finds the address of a field in the object whose reference is currently on the evaluation stack.</summary>
// Token: 0x040008D8 RID: 2264
public static readonly OpCode Ldflda = new OpCode(169180415, 83952385);
/// <summary>Replaces the value stored in the field of an object reference or pointer with a new value.</summary>
// Token: 0x040008D9 RID: 2265
public static readonly OpCode Stfld = new OpCode(185761279, 83952385);
/// <summary>Pushes the value of a static field onto the evaluation stack.</summary>
// Token: 0x040008DA RID: 2266
public static readonly OpCode Ldsfld = new OpCode(1277695, 83952385);
/// <summary>Pushes the address of a static field onto the evaluation stack.</summary>
// Token: 0x040008DB RID: 2267
public static readonly OpCode Ldsflda = new OpCode(1409023, 83952385);
/// <summary>Replaces the value of a static field with a value from the evaluation stack.</summary>
// Token: 0x040008DC RID: 2268
public static readonly OpCode Stsfld = new OpCode(17989887, 83952385);
/// <summary>Copies a value of a specified type from the evaluation stack into a supplied memory address.</summary>
// Token: 0x040008DD RID: 2269
public static readonly OpCode Stobj = new OpCode(68321791, 84739329);
/// <summary>Converts the unsigned value on top of the evaluation stack to signed int8 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008DE RID: 2270
public static readonly OpCode Conv_Ovf_I1_Un = new OpCode(18187007, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to signed int16 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008DF RID: 2271
public static readonly OpCode Conv_Ovf_I2_Un = new OpCode(18187263, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to signed int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E0 RID: 2272
public static readonly OpCode Conv_Ovf_I4_Un = new OpCode(18187519, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to signed int64, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E1 RID: 2273
public static readonly OpCode Conv_Ovf_I8_Un = new OpCode(18253311, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to unsigned int8 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E2 RID: 2274
public static readonly OpCode Conv_Ovf_U1_Un = new OpCode(18188031, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E3 RID: 2275
public static readonly OpCode Conv_Ovf_U2_Un = new OpCode(18188287, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to unsigned int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E4 RID: 2276
public static readonly OpCode Conv_Ovf_U4_Un = new OpCode(18188543, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to unsigned int64, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E5 RID: 2277
public static readonly OpCode Conv_Ovf_U8_Un = new OpCode(18254335, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to signed native int, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E6 RID: 2278
public static readonly OpCode Conv_Ovf_I_Un = new OpCode(18189055, 84215041);
/// <summary>Converts the unsigned value on top of the evaluation stack to unsigned native int, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x040008E7 RID: 2279
public static readonly OpCode Conv_Ovf_U_Un = new OpCode(18189311, 84215041);
/// <summary>Converts a value type to an object reference (type O).</summary>
// Token: 0x040008E8 RID: 2280
public static readonly OpCode Box = new OpCode(18451711, 84739329);
/// <summary>Pushes an object reference to a new zero-based, one-dimensional array whose elements are of a specific type onto the evaluation stack.</summary>
// Token: 0x040008E9 RID: 2281
public static readonly OpCode Newarr = new OpCode(52006399, 84738817);
/// <summary>Pushes the number of elements of a zero-based, one-dimensional array onto the evaluation stack.</summary>
// Token: 0x040008EA RID: 2282
public static readonly OpCode Ldlen = new OpCode(169185023, 84214529);
/// <summary>Loads the address of the array element at a specified array index onto the top of the evaluation stack as type &amp; (managed pointer).</summary>
// Token: 0x040008EB RID: 2283
public static readonly OpCode Ldelema = new OpCode(202739711, 84738817);
/// <summary>Loads the element with type int8 at a specified array index onto the top of the evaluation stack as an int32.</summary>
// Token: 0x040008EC RID: 2284
public static readonly OpCode Ldelem_I1 = new OpCode(202739967, 84214529);
/// <summary>Loads the element with type unsigned int8 at a specified array index onto the top of the evaluation stack as an int32.</summary>
// Token: 0x040008ED RID: 2285
public static readonly OpCode Ldelem_U1 = new OpCode(202740223, 84214529);
/// <summary>Loads the element with type int16 at a specified array index onto the top of the evaluation stack as an int32.</summary>
// Token: 0x040008EE RID: 2286
public static readonly OpCode Ldelem_I2 = new OpCode(202740479, 84214529);
/// <summary>Loads the element with type unsigned int16 at a specified array index onto the top of the evaluation stack as an int32.</summary>
// Token: 0x040008EF RID: 2287
public static readonly OpCode Ldelem_U2 = new OpCode(202740735, 84214529);
/// <summary>Loads the element with type int32 at a specified array index onto the top of the evaluation stack as an int32.</summary>
// Token: 0x040008F0 RID: 2288
public static readonly OpCode Ldelem_I4 = new OpCode(202740991, 84214529);
/// <summary>Loads the element with type unsigned int32 at a specified array index onto the top of the evaluation stack as an int32.</summary>
// Token: 0x040008F1 RID: 2289
public static readonly OpCode Ldelem_U4 = new OpCode(202741247, 84214529);
/// <summary>Loads the element with type int64 at a specified array index onto the top of the evaluation stack as an int64.</summary>
// Token: 0x040008F2 RID: 2290
public static readonly OpCode Ldelem_I8 = new OpCode(202807039, 84214529);
/// <summary>Loads the element with type native int at a specified array index onto the top of the evaluation stack as a native int.</summary>
// Token: 0x040008F3 RID: 2291
public static readonly OpCode Ldelem_I = new OpCode(202741759, 84214529);
/// <summary>Loads the element with type float32 at a specified array index onto the top of the evaluation stack as type F (float).</summary>
// Token: 0x040008F4 RID: 2292
public static readonly OpCode Ldelem_R4 = new OpCode(202873087, 84214529);
/// <summary>Loads the element with type float64 at a specified array index onto the top of the evaluation stack as type F (float).</summary>
// Token: 0x040008F5 RID: 2293
public static readonly OpCode Ldelem_R8 = new OpCode(202938879, 84214529);
/// <summary>Loads the element containing an object reference at a specified array index onto the top of the evaluation stack as type O (object reference).</summary>
// Token: 0x040008F6 RID: 2294
public static readonly OpCode Ldelem_Ref = new OpCode(203004671, 84214529);
/// <summary>Replaces the array element at a given index with the native int value on the evaluation stack.</summary>
// Token: 0x040008F7 RID: 2295
public static readonly OpCode Stelem_I = new OpCode(219323391, 84214529);
/// <summary>Replaces the array element at a given index with the int8 value on the evaluation stack.</summary>
// Token: 0x040008F8 RID: 2296
public static readonly OpCode Stelem_I1 = new OpCode(219323647, 84214529);
/// <summary>Replaces the array element at a given index with the int16 value on the evaluation stack.</summary>
// Token: 0x040008F9 RID: 2297
public static readonly OpCode Stelem_I2 = new OpCode(219323903, 84214529);
/// <summary>Replaces the array element at a given index with the int32 value on the evaluation stack.</summary>
// Token: 0x040008FA RID: 2298
public static readonly OpCode Stelem_I4 = new OpCode(219324159, 84214529);
/// <summary>Replaces the array element at a given index with the int64 value on the evaluation stack.</summary>
// Token: 0x040008FB RID: 2299
public static readonly OpCode Stelem_I8 = new OpCode(236101631, 84214529);
/// <summary>Replaces the array element at a given index with the float32 value on the evaluation stack.</summary>
// Token: 0x040008FC RID: 2300
public static readonly OpCode Stelem_R4 = new OpCode(252879103, 84214529);
/// <summary>Replaces the array element at a given index with the float64 value on the evaluation stack.</summary>
// Token: 0x040008FD RID: 2301
public static readonly OpCode Stelem_R8 = new OpCode(269656575, 84214529);
/// <summary>Replaces the array element at a given index with the object ref value (type O) on the evaluation stack.</summary>
// Token: 0x040008FE RID: 2302
public static readonly OpCode Stelem_Ref = new OpCode(286434047, 84214529);
/// <summary>Loads the element at a specified array index onto the top of the evaluation stack as the type specified in the instruction. </summary>
// Token: 0x040008FF RID: 2303
public static readonly OpCode Ldelem = new OpCode(202613759, 84738817);
/// <summary>Replaces the array element at a given index with the value on the evaluation stack, whose type is specified in the instruction.</summary>
// Token: 0x04000900 RID: 2304
public static readonly OpCode Stelem = new OpCode(470983935, 84738817);
/// <summary>Converts the boxed representation of a type specified in the instruction to its unboxed form. </summary>
// Token: 0x04000901 RID: 2305
public static readonly OpCode Unbox_Any = new OpCode(169059839, 84738817);
/// <summary>Converts the signed value on top of the evaluation stack to signed int8 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000902 RID: 2306
public static readonly OpCode Conv_Ovf_I1 = new OpCode(18199551, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to unsigned int8 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000903 RID: 2307
public static readonly OpCode Conv_Ovf_U1 = new OpCode(18199807, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to signed int16 and extending it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000904 RID: 2308
public static readonly OpCode Conv_Ovf_I2 = new OpCode(18200063, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000905 RID: 2309
public static readonly OpCode Conv_Ovf_U2 = new OpCode(18200319, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to signed int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000906 RID: 2310
public static readonly OpCode Conv_Ovf_I4 = new OpCode(18200575, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to unsigned int32, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000907 RID: 2311
public static readonly OpCode Conv_Ovf_U4 = new OpCode(18200831, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to signed int64, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000908 RID: 2312
public static readonly OpCode Conv_Ovf_I8 = new OpCode(18266623, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to unsigned int64, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000909 RID: 2313
public static readonly OpCode Conv_Ovf_U8 = new OpCode(18266879, 84215041);
/// <summary>Retrieves the address (type &amp;) embedded in a typed reference.</summary>
// Token: 0x0400090A RID: 2314
public static readonly OpCode Refanyval = new OpCode(18203391, 84739329);
/// <summary>Throws <see cref="T:System.ArithmeticException" /> if value is not a finite number.</summary>
// Token: 0x0400090B RID: 2315
public static readonly OpCode Ckfinite = new OpCode(18400255, 84215041);
/// <summary>Pushes a typed reference to an instance of a specific type onto the evaluation stack.</summary>
// Token: 0x0400090C RID: 2316
public static readonly OpCode Mkrefany = new OpCode(51627775, 84739329);
/// <summary>Converts a metadata token to its runtime representation, pushing it onto the evaluation stack.</summary>
// Token: 0x0400090D RID: 2317
public static readonly OpCode Ldtoken = new OpCode(1429759, 84673793);
/// <summary>Converts the value on top of the evaluation stack to unsigned int16, and extends it to int32.</summary>
// Token: 0x0400090E RID: 2318
public static readonly OpCode Conv_U2 = new OpCode(18207231, 84215041);
/// <summary>Converts the value on top of the evaluation stack to unsigned int8, and extends it to int32.</summary>
// Token: 0x0400090F RID: 2319
public static readonly OpCode Conv_U1 = new OpCode(18207487, 84215041);
/// <summary>Converts the value on top of the evaluation stack to native int.</summary>
// Token: 0x04000910 RID: 2320
public static readonly OpCode Conv_I = new OpCode(18207743, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to signed native int, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000911 RID: 2321
public static readonly OpCode Conv_Ovf_I = new OpCode(18207999, 84215041);
/// <summary>Converts the signed value on top of the evaluation stack to unsigned native int, throwing <see cref="T:System.OverflowException" /> on overflow.</summary>
// Token: 0x04000912 RID: 2322
public static readonly OpCode Conv_Ovf_U = new OpCode(18208255, 84215041);
/// <summary>Adds two integers, performs an overflow check, and pushes the result onto the evaluation stack.</summary>
// Token: 0x04000913 RID: 2323
public static readonly OpCode Add_Ovf = new OpCode(34854655, 84215041);
/// <summary>Adds two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack.</summary>
// Token: 0x04000914 RID: 2324
public static readonly OpCode Add_Ovf_Un = new OpCode(34854911, 84215041);
/// <summary>Multiplies two integer values, performs an overflow check, and pushes the result onto the evaluation stack.</summary>
// Token: 0x04000915 RID: 2325
public static readonly OpCode Mul_Ovf = new OpCode(34855167, 84215041);
/// <summary>Multiplies two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack.</summary>
// Token: 0x04000916 RID: 2326
public static readonly OpCode Mul_Ovf_Un = new OpCode(34855423, 84215041);
/// <summary>Subtracts one integer value from another, performs an overflow check, and pushes the result onto the evaluation stack.</summary>
// Token: 0x04000917 RID: 2327
public static readonly OpCode Sub_Ovf = new OpCode(34855679, 84215041);
/// <summary>Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack.</summary>
// Token: 0x04000918 RID: 2328
public static readonly OpCode Sub_Ovf_Un = new OpCode(34855935, 84215041);
/// <summary>Transfers control from the fault or finally clause of an exception block back to the Common Language Infrastructure (CLI) exception handler.</summary>
// Token: 0x04000919 RID: 2329
public static readonly OpCode Endfinally = new OpCode(1236223, 117769473);
/// <summary>Exits a protected region of code, unconditionally transferring control to a specific target instruction.</summary>
// Token: 0x0400091A RID: 2330
public static readonly OpCode Leave = new OpCode(1236479, 1281);
/// <summary>Exits a protected region of code, unconditionally transferring control to a target instruction (short form).</summary>
// Token: 0x0400091B RID: 2331
public static readonly OpCode Leave_S = new OpCode(1236735, 984321);
/// <summary>Stores a value of type native int at a supplied address.</summary>
// Token: 0x0400091C RID: 2332
public static readonly OpCode Stind_I = new OpCode(85123071, 84215041);
/// <summary>Converts the value on top of the evaluation stack to unsigned native int, and extends it to native int.</summary>
// Token: 0x0400091D RID: 2333
public static readonly OpCode Conv_U = new OpCode(18211071, 84215041);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x0400091E RID: 2334
public static readonly OpCode Prefix7 = new OpCode(1243391, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x0400091F RID: 2335
public static readonly OpCode Prefix6 = new OpCode(1243647, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x04000920 RID: 2336
public static readonly OpCode Prefix5 = new OpCode(1243903, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x04000921 RID: 2337
public static readonly OpCode Prefix4 = new OpCode(1244159, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x04000922 RID: 2338
public static readonly OpCode Prefix3 = new OpCode(1244415, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x04000923 RID: 2339
public static readonly OpCode Prefix2 = new OpCode(1244671, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x04000924 RID: 2340
public static readonly OpCode Prefix1 = new OpCode(1244927, 67437057);
/// <summary>This is a reserved instruction.</summary>
// Token: 0x04000925 RID: 2341
public static readonly OpCode Prefixref = new OpCode(1245183, 67437057);
/// <summary>Returns an unmanaged pointer to the argument list of the current method.</summary>
// Token: 0x04000926 RID: 2342
public static readonly OpCode Arglist = new OpCode(1376510, 84215042);
/// <summary>Compares two values. If they are equal, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.</summary>
// Token: 0x04000927 RID: 2343
public static readonly OpCode Ceq = new OpCode(34931198, 84215042);
/// <summary>Compares two values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.</summary>
// Token: 0x04000928 RID: 2344
public static readonly OpCode Cgt = new OpCode(34931454, 84215042);
/// <summary>Compares two unsigned or unordered values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.</summary>
// Token: 0x04000929 RID: 2345
public static readonly OpCode Cgt_Un = new OpCode(34931710, 84215042);
/// <summary>Compares two values. If the first value is less than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.</summary>
// Token: 0x0400092A RID: 2346
public static readonly OpCode Clt = new OpCode(34931966, 84215042);
/// <summary>Compares the unsigned or unordered values <paramref name="value1" /> and <paramref name="value2" />. If <paramref name="value1" /> is less than <paramref name="value2" />, then the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack.</summary>
// Token: 0x0400092B RID: 2347
public static readonly OpCode Clt_Un = new OpCode(34932222, 84215042);
/// <summary>Pushes an unmanaged pointer (type native int) to the native code implementing a specific method onto the evaluation stack.</summary>
// Token: 0x0400092C RID: 2348
public static readonly OpCode Ldftn = new OpCode(1378046, 84149506);
/// <summary>Pushes an unmanaged pointer (type native int) to the native code implementing a particular virtual method associated with a specified object onto the evaluation stack.</summary>
// Token: 0x0400092D RID: 2349
public static readonly OpCode Ldvirtftn = new OpCode(169150462, 84149506);
/// <summary>Loads an argument (referenced by a specified index value) onto the stack.</summary>
// Token: 0x0400092E RID: 2350
public static readonly OpCode Ldarg = new OpCode(1247742, 84804866);
/// <summary>Load an argument address onto the evaluation stack.</summary>
// Token: 0x0400092F RID: 2351
public static readonly OpCode Ldarga = new OpCode(1379070, 84804866);
/// <summary>Stores the value on top of the evaluation stack in the argument slot at a specified index.</summary>
// Token: 0x04000930 RID: 2352
public static readonly OpCode Starg = new OpCode(17959934, 84804866);
/// <summary>Loads the local variable at a specific index onto the evaluation stack.</summary>
// Token: 0x04000931 RID: 2353
public static readonly OpCode Ldloc = new OpCode(1248510, 84804866);
/// <summary>Loads the address of the local variable at a specific index onto the evaluation stack.</summary>
// Token: 0x04000932 RID: 2354
public static readonly OpCode Ldloca = new OpCode(1379838, 84804866);
/// <summary>Pops the current value from the top of the evaluation stack and stores it in a the local variable list at a specified index.</summary>
// Token: 0x04000933 RID: 2355
public static readonly OpCode Stloc = new OpCode(17960702, 84804866);
/// <summary>Allocates a certain number of bytes from the local dynamic memory pool and pushes the address (a transient pointer, type *) of the first allocated byte onto the evaluation stack.</summary>
// Token: 0x04000934 RID: 2356
public static readonly OpCode Localloc = new OpCode(51711998, 84215042);
/// <summary>Transfers control from the filter clause of an exception back to the Common Language Infrastructure (CLI) exception handler.</summary>
// Token: 0x04000935 RID: 2357
public static readonly OpCode Endfilter = new OpCode(51515902, 117769474);
/// <summary>Indicates that an address currently atop the evaluation stack might not be aligned to the natural size of the immediately following ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction.</summary>
// Token: 0x04000936 RID: 2358
public static readonly OpCode Unaligned = new OpCode(1184510, 68158466);
/// <summary>Specifies that an address currently atop the evaluation stack might be volatile, and the results of reading that location cannot be cached or that multiple stores to that location cannot be suppressed.</summary>
// Token: 0x04000937 RID: 2359
public static readonly OpCode Volatile = new OpCode(1184766, 67437570);
/// <summary>Performs a postfixed method call instruction such that the current method's stack frame is removed before the actual call instruction is executed.</summary>
// Token: 0x04000938 RID: 2360
public static readonly OpCode Tailcall = new OpCode(1185022, 67437570);
/// <summary>Initializes each field of the value type at a specified address to a null reference or a 0 of the appropriate primitive type.</summary>
// Token: 0x04000939 RID: 2361
public static readonly OpCode Initobj = new OpCode(51516926, 84738818);
/// <summary>Constrains the type on which a virtual method call is made.</summary>
// Token: 0x0400093A RID: 2362
public static readonly OpCode Constrained = new OpCode(1185534, 67961858);
/// <summary>Copies a specified number bytes from a source address to a destination address.</summary>
// Token: 0x0400093B RID: 2363
public static readonly OpCode Cpblk = new OpCode(118626302, 84215042);
/// <summary>Initializes a specified block of memory at a specific address to a given size and initial value.</summary>
// Token: 0x0400093C RID: 2364
public static readonly OpCode Initblk = new OpCode(118626558, 84215042);
/// <summary>Rethrows the current exception.</summary>
// Token: 0x0400093D RID: 2365
public static readonly OpCode Rethrow = new OpCode(1186558, 134546178);
/// <summary>Pushes the size, in bytes, of a supplied value type onto the evaluation stack.</summary>
// Token: 0x0400093E RID: 2366
public static readonly OpCode Sizeof = new OpCode(1383678, 84739330);
/// <summary>Retrieves the type token embedded in a typed reference.</summary>
// Token: 0x0400093F RID: 2367
public static readonly OpCode Refanytype = new OpCode(18161150, 84215042);
/// <summary>Specifies that the subsequent array address operation performs no type check at run time, and that it returns a managed pointer whose mutability is restricted.</summary>
// Token: 0x04000940 RID: 2368
public static readonly OpCode Readonly = new OpCode(1187582, 67437570);
}
}
@@ -0,0 +1,68 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes the operand type of Microsoft intermediate language (MSIL) instruction.</summary>
// Token: 0x0200020E RID: 526
[ComVisible(true)]
[Serializable]
public enum OperandType
{
/// <summary>The operand is a 32-bit integer branch target.</summary>
// Token: 0x04000942 RID: 2370
InlineBrTarget,
/// <summary>The operand is a 32-bit metadata token.</summary>
// Token: 0x04000943 RID: 2371
InlineField,
/// <summary>The operand is a 32-bit integer.</summary>
// Token: 0x04000944 RID: 2372
InlineI,
/// <summary>The operand is a 64-bit integer.</summary>
// Token: 0x04000945 RID: 2373
InlineI8,
/// <summary>The operand is a 32-bit metadata token.</summary>
// Token: 0x04000946 RID: 2374
InlineMethod,
/// <summary>No operand.</summary>
// Token: 0x04000947 RID: 2375
InlineNone,
/// <summary>The operand is reserved and should not be used.</summary>
// Token: 0x04000948 RID: 2376
[Obsolete("This API has been deprecated.")]
InlinePhi,
/// <summary>The operand is a 64-bit IEEE floating point number.</summary>
// Token: 0x04000949 RID: 2377
InlineR,
/// <summary>The operand is a 32-bit metadata signature token.</summary>
// Token: 0x0400094A RID: 2378
InlineSig = 9,
/// <summary>The operand is a 32-bit metadata string token.</summary>
// Token: 0x0400094B RID: 2379
InlineString,
/// <summary>The operand is the 32-bit integer argument to a switch instruction.</summary>
// Token: 0x0400094C RID: 2380
InlineSwitch,
/// <summary>The operand is a FieldRef, MethodRef, or TypeRef token.</summary>
// Token: 0x0400094D RID: 2381
InlineTok,
/// <summary>The operand is a 32-bit metadata token.</summary>
// Token: 0x0400094E RID: 2382
InlineType,
/// <summary>The operand is 16-bit integer containing the ordinal of a local variable or an argument.</summary>
// Token: 0x0400094F RID: 2383
InlineVar,
/// <summary>The operand is an 8-bit integer branch target.</summary>
// Token: 0x04000950 RID: 2384
ShortInlineBrTarget,
/// <summary>The operand is an 8-bit integer.</summary>
// Token: 0x04000951 RID: 2385
ShortInlineI,
/// <summary>The operand is a 32-bit IEEE floating point number.</summary>
// Token: 0x04000952 RID: 2386
ShortInlineR,
/// <summary>The operand is an 8-bit integer containing the ordinal of a local variable or an argumenta.</summary>
// Token: 0x04000953 RID: 2387
ShortInlineVar
}
}
@@ -0,0 +1,22 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Specifies the type of the portable executable (PE) file.</summary>
// Token: 0x0200020F RID: 527
[ComVisible(true)]
[Serializable]
public enum PEFileKinds
{
/// <summary>The portable executable (PE) file is a DLL.</summary>
// Token: 0x04000955 RID: 2389
Dll = 1,
/// <summary>The application is a console (not a Windows-based) application.</summary>
// Token: 0x04000956 RID: 2390
ConsoleApplication,
/// <summary>The application is a Windows-based application.</summary>
// Token: 0x04000957 RID: 2391
WindowApplication
}
}
@@ -0,0 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Specifies one of two factors that determine the memory alignment of fields when a type is marshaled.</summary>
// Token: 0x02000210 RID: 528
[ComVisible(true)]
[Serializable]
public enum PackingSize
{
/// <summary>The packing size is not specified.</summary>
// Token: 0x04000959 RID: 2393
Unspecified,
/// <summary>The packing size is 1 byte.</summary>
// Token: 0x0400095A RID: 2394
Size1,
/// <summary>The packing size is 2 bytes.</summary>
// Token: 0x0400095B RID: 2395
Size2,
/// <summary>The packing size is 4 bytes.</summary>
// Token: 0x0400095C RID: 2396
Size4 = 4,
/// <summary>The packing size is 8 bytes.</summary>
// Token: 0x0400095D RID: 2397
Size8 = 8,
/// <summary>The packing size is 16 bytes.</summary>
// Token: 0x0400095E RID: 2398
Size16 = 16,
/// <summary>The packing size is 32 bytes.</summary>
// Token: 0x0400095F RID: 2399
Size32 = 32,
/// <summary>The packing size is 64 bytes.</summary>
// Token: 0x04000960 RID: 2400
Size64 = 64,
/// <summary>The packing size is 128 bytes.</summary>
// Token: 0x04000961 RID: 2401
Size128 = 128
}
}
@@ -0,0 +1,265 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Creates or associates parameter information.</summary>
// Token: 0x02000211 RID: 529
[ComVisible(true)]
[ComDefaultInterface(typeof(_ParameterBuilder))]
[ClassInterface(ClassInterfaceType.None)]
public class ParameterBuilder : _ParameterBuilder
{
// Token: 0x06001BD5 RID: 7125 RVA: 0x00069B08 File Offset: 0x00067D08
internal ParameterBuilder(MethodBase mb, int pos, ParameterAttributes attributes, string strParamName)
{
this.name = strParamName;
this.position = pos;
this.attrs = attributes;
this.methodb = mb;
if (mb is DynamicMethod)
{
this.table_idx = 0;
}
else
{
this.table_idx = mb.get_next_table_index(this, 8, true);
}
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BD6 RID: 7126 RVA: 0x00069B60 File Offset: 0x00067D60
void _ParameterBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BD7 RID: 7127 RVA: 0x00069B68 File Offset: 0x00067D68
void _ParameterBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BD8 RID: 7128 RVA: 0x00069B70 File Offset: 0x00067D70
void _ParameterBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BD9 RID: 7129 RVA: 0x00069B78 File Offset: 0x00067D78
void _ParameterBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the attributes for this parameter.</summary>
/// <returns>Read-only. Retrieves the attributes for this parameter.</returns>
// Token: 0x170004FB RID: 1275
// (get) Token: 0x06001BDA RID: 7130 RVA: 0x00069B80 File Offset: 0x00067D80
public virtual int Attributes
{
get
{
return (int)this.attrs;
}
}
/// <summary>Retrieves whether this is an input parameter.</summary>
/// <returns>Read-only. Retrieves whether this is an input parameter.</returns>
// Token: 0x170004FC RID: 1276
// (get) Token: 0x06001BDB RID: 7131 RVA: 0x00069B88 File Offset: 0x00067D88
public bool IsIn
{
get
{
return (this.attrs & ParameterAttributes.In) != ParameterAttributes.None;
}
}
/// <summary>Retrieves whether this parameter is an output parameter.</summary>
/// <returns>Read-only. Retrieves whether this parameter is an output parameter.</returns>
// Token: 0x170004FD RID: 1277
// (get) Token: 0x06001BDC RID: 7132 RVA: 0x00069B98 File Offset: 0x00067D98
public bool IsOut
{
get
{
return (this.attrs & ParameterAttributes.Out) != ParameterAttributes.None;
}
}
/// <summary>Retrieves whether this parameter is optional.</summary>
/// <returns>Read-only. Specifies whether this parameter is optional.</returns>
// Token: 0x170004FE RID: 1278
// (get) Token: 0x06001BDD RID: 7133 RVA: 0x00069BA8 File Offset: 0x00067DA8
public bool IsOptional
{
get
{
return (this.attrs & ParameterAttributes.Optional) != ParameterAttributes.None;
}
}
/// <summary>Retrieves the name of this parameter.</summary>
/// <returns>Read-only. Retrieves the name of this parameter.</returns>
// Token: 0x170004FF RID: 1279
// (get) Token: 0x06001BDE RID: 7134 RVA: 0x00069BBC File Offset: 0x00067DBC
public virtual string Name
{
get
{
return this.name;
}
}
/// <summary>Retrieves the signature position for this parameter.</summary>
/// <returns>Read-only. Retrieves the signature position for this parameter.</returns>
// Token: 0x17000500 RID: 1280
// (get) Token: 0x06001BDF RID: 7135 RVA: 0x00069BC4 File Offset: 0x00067DC4
public virtual int Position
{
get
{
return this.position;
}
}
/// <summary>Retrieves the token for this parameter.</summary>
/// <returns>Returns the token for this parameter.</returns>
// Token: 0x06001BE0 RID: 7136 RVA: 0x00069BCC File Offset: 0x00067DCC
public virtual ParameterToken GetToken()
{
return new ParameterToken(8 | this.table_idx);
}
/// <summary>Sets the default value of the parameter.</summary>
/// <param name="defaultValue">The default value of this parameter. </param>
/// <exception cref="T:System.ArgumentException">The parameter is not one of the supported types.-or-The type of <paramref name="defaultValue" /> does not match the type of the parameter.-or-The parameter is of type <see cref="T:System.Object" /> or other reference type, and <paramref name="defaultValue" /> is not null. </exception>
// Token: 0x06001BE1 RID: 7137 RVA: 0x00069BDC File Offset: 0x00067DDC
public virtual void SetConstant(object defaultValue)
{
this.def_value = defaultValue;
this.attrs |= ParameterAttributes.HasDefault;
}
/// <summary>Set a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> is null. </exception>
// Token: 0x06001BE2 RID: 7138 RVA: 0x00069BF8 File Offset: 0x00067DF8
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Runtime.InteropServices.InAttribute")
{
this.attrs |= ParameterAttributes.In;
return;
}
if (fullName == "System.Runtime.InteropServices.OutAttribute")
{
this.attrs |= ParameterAttributes.Out;
return;
}
if (fullName == "System.Runtime.InteropServices.OptionalAttribute")
{
this.attrs |= ParameterAttributes.Optional;
return;
}
if (fullName == "System.Runtime.InteropServices.MarshalAsAttribute")
{
this.attrs |= ParameterAttributes.HasFieldMarshal;
this.marshal_info = CustomAttributeBuilder.get_umarshal(customBuilder, false);
return;
}
if (fullName == "System.Runtime.InteropServices.DefaultParameterValueAttribute")
{
this.SetConstant(CustomAttributeBuilder.decode_cattr(customBuilder).ctorArgs[0]);
return;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Set a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
// Token: 0x06001BE3 RID: 7139 RVA: 0x00069D20 File Offset: 0x00067F20
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Specifies the marshaling for this parameter.</summary>
/// <param name="unmanagedMarshal">The marshaling information for this parameter. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="unmanagedMarshal" /> is null. </exception>
// Token: 0x06001BE4 RID: 7140 RVA: 0x00069D30 File Offset: 0x00067F30
[Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
public virtual void SetMarshal(UnmanagedMarshal unmanagedMarshal)
{
this.marshal_info = unmanagedMarshal;
this.attrs |= ParameterAttributes.HasFieldMarshal;
}
// Token: 0x04000962 RID: 2402
private MethodBase methodb;
// Token: 0x04000963 RID: 2403
private string name;
// Token: 0x04000964 RID: 2404
private CustomAttributeBuilder[] cattrs;
// Token: 0x04000965 RID: 2405
private UnmanagedMarshal marshal_info;
// Token: 0x04000966 RID: 2406
private ParameterAttributes attrs;
// Token: 0x04000967 RID: 2407
private int position;
// Token: 0x04000968 RID: 2408
private int table_idx;
// Token: 0x04000969 RID: 2409
private object def_value;
}
}
@@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>The ParameterToken struct is an opaque representation of the token returned by the metadata to represent a parameter.</summary>
// Token: 0x02000212 RID: 530
[ComVisible(true)]
[Serializable]
public struct ParameterToken
{
// Token: 0x06001BE5 RID: 7141 RVA: 0x00069D4C File Offset: 0x00067F4C
internal ParameterToken(int val)
{
this.tokValue = val;
}
/// <summary>Checks if the given object is an instance of ParameterToken and is equal to this instance.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of ParameterToken and equals the current instance; otherwise, false.</returns>
/// <param name="obj">The object to compare to this object. </param>
// Token: 0x06001BE7 RID: 7143 RVA: 0x00069D74 File Offset: 0x00067F74
public override bool Equals(object obj)
{
bool flag = obj is ParameterToken;
if (flag)
{
ParameterToken parameterToken = (ParameterToken)obj;
flag = this.tokValue == parameterToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.ParameterToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.ParameterToken" /> to compare to the current instance.</param>
// Token: 0x06001BE8 RID: 7144 RVA: 0x00069DAC File Offset: 0x00067FAC
public bool Equals(ParameterToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Generates the hash code for this parameter.</summary>
/// <returns>Returns the hash code for this parameter.</returns>
// Token: 0x06001BE9 RID: 7145 RVA: 0x00069DC0 File Offset: 0x00067FC0
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for this parameter.</summary>
/// <returns>Read-only. Retrieves the metadata token for this parameter.</returns>
// Token: 0x17000501 RID: 1281
// (get) Token: 0x06001BEA RID: 7146 RVA: 0x00069DC8 File Offset: 0x00067FC8
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.ParameterToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.ParameterToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.ParameterToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001BEB RID: 7147 RVA: 0x00069DD0 File Offset: 0x00067FD0
public static bool operator ==(ParameterToken a, ParameterToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.ParameterToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.ParameterToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.ParameterToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001BEC RID: 7148 RVA: 0x00069DE4 File Offset: 0x00067FE4
public static bool operator !=(ParameterToken a, ParameterToken b)
{
return !object.Equals(a, b);
}
// Token: 0x0400096A RID: 2410
internal int tokValue;
/// <summary>The default ParameterToken with <see cref="P:System.Reflection.Emit.ParameterToken.Token" /> value 0.</summary>
// Token: 0x0400096B RID: 2411
public static readonly ParameterToken Empty = default(ParameterToken);
}
}
@@ -0,0 +1,40 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001EA RID: 490
internal class PointerType : DerivedType
{
// Token: 0x06001974 RID: 6516 RVA: 0x00061808 File Offset: 0x0005FA08
internal PointerType(Type elementType)
: base(elementType)
{
}
// Token: 0x06001975 RID: 6517 RVA: 0x00061814 File Offset: 0x0005FA14
protected override bool IsPointerImpl()
{
return true;
}
// Token: 0x1700047A RID: 1146
// (get) Token: 0x06001976 RID: 6518 RVA: 0x00061818 File Offset: 0x0005FA18
public override Type BaseType
{
get
{
return typeof(Array);
}
}
// Token: 0x06001977 RID: 6519 RVA: 0x00061824 File Offset: 0x0005FA24
internal override string FormatName(string elementName)
{
if (elementName == null)
{
return null;
}
return elementName + "*";
}
}
}
@@ -0,0 +1,443 @@
using System;
using System.Globalization;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Defines the properties for a type.</summary>
// Token: 0x02000213 RID: 531
[ComDefaultInterface(typeof(_PropertyBuilder))]
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
public sealed class PropertyBuilder : PropertyInfo, _PropertyBuilder
{
// Token: 0x06001BED RID: 7149 RVA: 0x00069DFC File Offset: 0x00067FFC
internal PropertyBuilder(TypeBuilder tb, string name, PropertyAttributes attributes, Type returnType, Type[] returnModReq, Type[] returnModOpt, Type[] parameterTypes, Type[][] paramModReq, Type[][] paramModOpt)
{
this.name = name;
this.attrs = attributes;
this.type = returnType;
this.returnModReq = returnModReq;
this.returnModOpt = returnModOpt;
this.paramModReq = paramModReq;
this.paramModOpt = paramModOpt;
if (parameterTypes != null)
{
this.parameters = new Type[parameterTypes.Length];
Array.Copy(parameterTypes, this.parameters, this.parameters.Length);
}
this.typeb = tb;
this.table_idx = tb.get_next_table_index(this, 23, true);
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BEE RID: 7150 RVA: 0x00069E88 File Offset: 0x00068088
void _PropertyBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BEF RID: 7151 RVA: 0x00069E90 File Offset: 0x00068090
void _PropertyBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BF0 RID: 7152 RVA: 0x00069E98 File Offset: 0x00068098
void _PropertyBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
// Token: 0x06001BF1 RID: 7153 RVA: 0x00069EA0 File Offset: 0x000680A0
void _PropertyBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Gets the attributes for this property.</summary>
/// <returns>Attributes of this property.</returns>
// Token: 0x17000502 RID: 1282
// (get) Token: 0x06001BF2 RID: 7154 RVA: 0x00069EA8 File Offset: 0x000680A8
public override PropertyAttributes Attributes
{
get
{
return this.attrs;
}
}
/// <summary>Gets a value indicating whether the property can be read.</summary>
/// <returns>true if this property can be read; otherwise, false.</returns>
// Token: 0x17000503 RID: 1283
// (get) Token: 0x06001BF3 RID: 7155 RVA: 0x00069EB0 File Offset: 0x000680B0
public override bool CanRead
{
get
{
return this.get_method != null;
}
}
/// <summary>Gets a value indicating whether the property can be written to.</summary>
/// <returns>true if this property can be written to; otherwise, false.</returns>
// Token: 0x17000504 RID: 1284
// (get) Token: 0x06001BF4 RID: 7156 RVA: 0x00069EC0 File Offset: 0x000680C0
public override bool CanWrite
{
get
{
return this.set_method != null;
}
}
/// <summary>Gets the class that declares this member.</summary>
/// <returns>The Type object for the class that declares this member.</returns>
// Token: 0x17000505 RID: 1285
// (get) Token: 0x06001BF5 RID: 7157 RVA: 0x00069ED0 File Offset: 0x000680D0
public override Type DeclaringType
{
get
{
return this.typeb;
}
}
/// <summary>Gets the name of this member.</summary>
/// <returns>A <see cref="T:System.String" /> containing the name of this member.</returns>
// Token: 0x17000506 RID: 1286
// (get) Token: 0x06001BF6 RID: 7158 RVA: 0x00069ED8 File Offset: 0x000680D8
public override string Name
{
get
{
return this.name;
}
}
/// <summary>Retrieves the token for this property.</summary>
/// <returns>Read-only. Retrieves the token for this property.</returns>
// Token: 0x17000507 RID: 1287
// (get) Token: 0x06001BF7 RID: 7159 RVA: 0x00069EE0 File Offset: 0x000680E0
public PropertyToken PropertyToken
{
get
{
return default(PropertyToken);
}
}
/// <summary>Gets the type of the field of this property.</summary>
/// <returns>The type of this property.</returns>
// Token: 0x17000508 RID: 1288
// (get) Token: 0x06001BF8 RID: 7160 RVA: 0x00069EF8 File Offset: 0x000680F8
public override Type PropertyType
{
get
{
return this.type;
}
}
/// <summary>Gets the class object that was used to obtain this instance of MemberInfo.</summary>
/// <returns>The Type object through which this MemberInfo object was obtained.</returns>
// Token: 0x17000509 RID: 1289
// (get) Token: 0x06001BF9 RID: 7161 RVA: 0x00069F00 File Offset: 0x00068100
public override Type ReflectedType
{
get
{
return this.typeb;
}
}
/// <summary>Adds one of the other methods associated with this property.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the other method. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x06001BFA RID: 7162 RVA: 0x00069F08 File Offset: 0x00068108
public void AddOtherMethod(MethodBuilder mdBuilder)
{
}
/// <summary>Returns an array of the public and non-public get and set accessors on this property.</summary>
/// <returns>An array of type MethodInfo containing the matching public or non-public accessors, or an empty array if matching accessors do not exist on this property.</returns>
/// <param name="nonPublic">Indicates whether non-public methods should be returned in the MethodInfo array. true if non-public methods are to be included; otherwise, false. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001BFB RID: 7163 RVA: 0x00069F0C File Offset: 0x0006810C
public override MethodInfo[] GetAccessors(bool nonPublic)
{
return null;
}
/// <summary>Returns an array of all the custom attributes for this property.</summary>
/// <returns>An array of all the custom attributes.</returns>
/// <param name="inherit">If true, walks up this property's inheritance chain to find the custom attributes </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001BFC RID: 7164 RVA: 0x00069F10 File Offset: 0x00068110
public override object[] GetCustomAttributes(bool inherit)
{
throw this.not_supported();
}
/// <summary>Returns an array of custom attributes identified by <see cref="T:System.Type" />.</summary>
/// <returns>An array of custom attributes defined on this reflected member, or null if no attributes are defined on this member.</returns>
/// <param name="attributeType">An array of custom attributes identified by type. </param>
/// <param name="inherit">If true, walks up this property's inheritance chain to find the custom attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001BFD RID: 7165 RVA: 0x00069F18 File Offset: 0x00068118
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw this.not_supported();
}
/// <summary>Returns the public and non-public get accessor for this property.</summary>
/// <returns>A MethodInfo object representing the get accessor for this property, if <paramref name="nonPublic" /> is true. Returns null if <paramref name="nonPublic" /> is false and the get accessor is non-public, or if <paramref name="nonPublic" /> is true but no get accessors exist.</returns>
/// <param name="nonPublic">Indicates whether non-public get accessors should be returned. true if non-public methods are to be included; otherwise, false. </param>
// Token: 0x06001BFE RID: 7166 RVA: 0x00069F20 File Offset: 0x00068120
public override MethodInfo GetGetMethod(bool nonPublic)
{
return this.get_method;
}
/// <summary>Returns an array of all the index parameters for the property.</summary>
/// <returns>An array of type ParameterInfo containing the parameters for the indexes.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001BFF RID: 7167 RVA: 0x00069F28 File Offset: 0x00068128
public override ParameterInfo[] GetIndexParameters()
{
throw this.not_supported();
}
/// <summary>Returns the set accessor for this property.</summary>
/// <returns>Value Condition A <see cref="T:System.Reflection.MethodInfo" /> object representing the Set method for this property. The set accessor is public.<paramref name="nonPublic" /> is true and non-public methods can be returned. null <paramref name="nonPublic" /> is true, but the property is read-only.<paramref name="nonPublic" /> is false and the set accessor is non-public. </returns>
/// <param name="nonPublic">Indicates whether the accessor should be returned if it is non-public. true if non-public methods are to be included; otherwise, false. </param>
// Token: 0x06001C00 RID: 7168 RVA: 0x00069F30 File Offset: 0x00068130
public override MethodInfo GetSetMethod(bool nonPublic)
{
return this.set_method;
}
/// <summary>Gets the value of the indexed property by calling the property's getter method.</summary>
/// <returns>The value of the specified indexed property.</returns>
/// <param name="obj">The object whose property value will be returned. </param>
/// <param name="index">Optional index values for indexed properties. This value should be null for non-indexed properties. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001C01 RID: 7169 RVA: 0x00069F38 File Offset: 0x00068138
public override object GetValue(object obj, object[] index)
{
return null;
}
/// <summary>Gets the value of a property having the specified binding, index, and CultureInfo.</summary>
/// <returns>The property value for <paramref name="obj" />.</returns>
/// <param name="obj">The object whose property value will be returned. </param>
/// <param name="invokeAttr">The invocation attribute. This must be a bit flag from BindingFlags : InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. A suitable invocation attribute must be specified. If a static member is to be invoked, the Static flag of BindingFlags must be set. </param>
/// <param name="binder">An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If <paramref name="binder" /> is null, the default binder is used. </param>
/// <param name="index">Optional index values for indexed properties. This value should be null for non-indexed properties. </param>
/// <param name="culture">The CultureInfo object that represents the culture for which the resource is to be localized. Note that if the resource is not localized for this culture, the CultureInfo.Parent method will be called successively in search of a match. If this value is null, the CultureInfo is obtained from the CultureInfo.CurrentUICulture property. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001C02 RID: 7170 RVA: 0x00069F3C File Offset: 0x0006813C
public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
{
throw this.not_supported();
}
/// <summary>Indicates whether one or more instance of <paramref name="attributeType" /> is defined on this property.</summary>
/// <returns>true if one or more instance of <paramref name="attributeType" /> is defined on this property; otherwise false.</returns>
/// <param name="attributeType">The Type object to which the custom attributes are applied. </param>
/// <param name="inherit">Specifies whether to walk up this property's inheritance chain to find the custom attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001C03 RID: 7171 RVA: 0x00069F44 File Offset: 0x00068144
public override bool IsDefined(Type attributeType, bool inherit)
{
throw this.not_supported();
}
/// <summary>Sets the default value of this property.</summary>
/// <param name="defaultValue">The default value of this property. </param>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
/// <exception cref="T:System.ArgumentException">The property is not one of the supported types.-or-The type of <paramref name="defaultValue" /> does not match the type of the property.-or-The property is of type <see cref="T:System.Object" /> or other reference type, and <paramref name="defaultValue" /> is not null.</exception>
// Token: 0x06001C04 RID: 7172 RVA: 0x00069F4C File Offset: 0x0006814C
public void SetConstant(object defaultValue)
{
this.def_value = defaultValue;
}
/// <summary>Set a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="customBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">if <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x06001C05 RID: 7173 RVA: 0x00069F58 File Offset: 0x00068158
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Runtime.CompilerServices.SpecialNameAttribute")
{
this.attrs |= PropertyAttributes.SpecialName;
return;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Set a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x06001C06 RID: 7174 RVA: 0x00069FF0 File Offset: 0x000681F0
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Sets the method that gets the property value.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the method that gets the property value. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x06001C07 RID: 7175 RVA: 0x0006A000 File Offset: 0x00068200
public void SetGetMethod(MethodBuilder mdBuilder)
{
this.get_method = mdBuilder;
}
/// <summary>Sets the method that sets the property value.</summary>
/// <param name="mdBuilder">A MethodBuilder object that represents the method that sets the property value. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mdBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been called on the enclosing type. </exception>
// Token: 0x06001C08 RID: 7176 RVA: 0x0006A00C File Offset: 0x0006820C
public void SetSetMethod(MethodBuilder mdBuilder)
{
this.set_method = mdBuilder;
}
/// <summary>Sets the value of the property with optional index values for index properties.</summary>
/// <param name="obj">The object whose property value will be set. </param>
/// <param name="value">The new value for this property. </param>
/// <param name="index">Optional index values for indexed properties. This value should be null for non-indexed properties. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001C09 RID: 7177 RVA: 0x0006A018 File Offset: 0x00068218
public override void SetValue(object obj, object value, object[] index)
{
}
/// <summary>Sets the property value for the given object to the given value.</summary>
/// <param name="obj">The object whose property value will be returned. </param>
/// <param name="value">The new value for this property. </param>
/// <param name="invokeAttr">The invocation attribute. This must be a bit flag from BindingFlags : InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. A suitable invocation attribute must be specified. If a static member is to be invoked, the Static flag of BindingFlags must be set. </param>
/// <param name="binder">An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If <paramref name="binder" /> is null, the default binder is used. </param>
/// <param name="index">Optional index values for indexed properties. This value should be null for non-indexed properties. </param>
/// <param name="culture">The CultureInfo object that represents the culture for which the resource is to be localized. Note that if the resource is not localized for this culture, the CultureInfo.Parent method will be called successively in search of a match. If this value is null, the CultureInfo is obtained from the CultureInfo.CurrentUICulture property. </param>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001C0A RID: 7178 RVA: 0x0006A01C File Offset: 0x0006821C
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
{
}
/// <summary>Gets the module in which the type that declares the current property is being defined.</summary>
/// <returns>The <see cref="T:System.Reflection.Module" /> in which the type that declares the current property is defined.</returns>
// Token: 0x1700050A RID: 1290
// (get) Token: 0x06001C0B RID: 7179 RVA: 0x0006A020 File Offset: 0x00068220
public override Module Module
{
get
{
return base.Module;
}
}
// Token: 0x06001C0C RID: 7180 RVA: 0x0006A028 File Offset: 0x00068228
private Exception not_supported()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
// Token: 0x0400096C RID: 2412
private PropertyAttributes attrs;
// Token: 0x0400096D RID: 2413
private string name;
// Token: 0x0400096E RID: 2414
private Type type;
// Token: 0x0400096F RID: 2415
private Type[] parameters;
// Token: 0x04000970 RID: 2416
private CustomAttributeBuilder[] cattrs;
// Token: 0x04000971 RID: 2417
private object def_value;
// Token: 0x04000972 RID: 2418
private MethodBuilder set_method;
// Token: 0x04000973 RID: 2419
private MethodBuilder get_method;
// Token: 0x04000974 RID: 2420
private int table_idx;
// Token: 0x04000975 RID: 2421
internal TypeBuilder typeb;
// Token: 0x04000976 RID: 2422
private Type[] returnModReq;
// Token: 0x04000977 RID: 2423
private Type[] returnModOpt;
// Token: 0x04000978 RID: 2424
private Type[][] paramModReq;
// Token: 0x04000979 RID: 2425
private Type[][] paramModOpt;
}
}
@@ -0,0 +1,188 @@
using System;
using System.Globalization;
namespace System.Reflection.Emit
{
// Token: 0x02000214 RID: 532
internal class PropertyOnTypeBuilderInst : PropertyInfo
{
// Token: 0x06001C0D RID: 7181 RVA: 0x0006A034 File Offset: 0x00068234
internal PropertyOnTypeBuilderInst(MonoGenericClass instantiation, PropertyInfo prop)
{
this.instantiation = instantiation;
this.prop = prop;
}
// Token: 0x1700050B RID: 1291
// (get) Token: 0x06001C0E RID: 7182 RVA: 0x0006A04C File Offset: 0x0006824C
public override PropertyAttributes Attributes
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x1700050C RID: 1292
// (get) Token: 0x06001C0F RID: 7183 RVA: 0x0006A054 File Offset: 0x00068254
public override bool CanRead
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x1700050D RID: 1293
// (get) Token: 0x06001C10 RID: 7184 RVA: 0x0006A05C File Offset: 0x0006825C
public override bool CanWrite
{
get
{
throw new NotSupportedException();
}
}
// Token: 0x1700050E RID: 1294
// (get) Token: 0x06001C11 RID: 7185 RVA: 0x0006A064 File Offset: 0x00068264
public override Type PropertyType
{
get
{
return this.instantiation.InflateType(this.prop.PropertyType);
}
}
// Token: 0x1700050F RID: 1295
// (get) Token: 0x06001C12 RID: 7186 RVA: 0x0006A07C File Offset: 0x0006827C
public override Type DeclaringType
{
get
{
return this.instantiation.InflateType(this.prop.DeclaringType);
}
}
// Token: 0x17000510 RID: 1296
// (get) Token: 0x06001C13 RID: 7187 RVA: 0x0006A094 File Offset: 0x00068294
public override Type ReflectedType
{
get
{
return this.instantiation;
}
}
// Token: 0x17000511 RID: 1297
// (get) Token: 0x06001C14 RID: 7188 RVA: 0x0006A09C File Offset: 0x0006829C
public override string Name
{
get
{
return this.prop.Name;
}
}
// Token: 0x06001C15 RID: 7189 RVA: 0x0006A0AC File Offset: 0x000682AC
public override MethodInfo[] GetAccessors(bool nonPublic)
{
MethodInfo getMethod = this.GetGetMethod(nonPublic);
MethodInfo setMethod = this.GetSetMethod(nonPublic);
int num = 0;
if (getMethod != null)
{
num++;
}
if (setMethod != null)
{
num++;
}
MethodInfo[] array = new MethodInfo[num];
num = 0;
if (getMethod != null)
{
array[num++] = getMethod;
}
if (setMethod != null)
{
array[num] = setMethod;
}
return array;
}
// Token: 0x06001C16 RID: 7190 RVA: 0x0006A104 File Offset: 0x00068304
public override MethodInfo GetGetMethod(bool nonPublic)
{
MethodInfo methodInfo = this.prop.GetGetMethod(nonPublic);
if (methodInfo != null && this.prop.DeclaringType == this.instantiation.generic_type)
{
methodInfo = TypeBuilder.GetMethod(this.instantiation, methodInfo);
}
return methodInfo;
}
// Token: 0x06001C17 RID: 7191 RVA: 0x0006A150 File Offset: 0x00068350
public override ParameterInfo[] GetIndexParameters()
{
MethodInfo getMethod = this.GetGetMethod(true);
if (getMethod != null)
{
return getMethod.GetParameters();
}
return new ParameterInfo[0];
}
// Token: 0x06001C18 RID: 7192 RVA: 0x0006A178 File Offset: 0x00068378
public override MethodInfo GetSetMethod(bool nonPublic)
{
MethodInfo methodInfo = this.prop.GetSetMethod(nonPublic);
if (methodInfo != null && this.prop.DeclaringType == this.instantiation.generic_type)
{
methodInfo = TypeBuilder.GetMethod(this.instantiation, methodInfo);
}
return methodInfo;
}
// Token: 0x06001C19 RID: 7193 RVA: 0x0006A1C4 File Offset: 0x000683C4
public override string ToString()
{
return string.Format("{0} {1}", this.PropertyType, this.Name);
}
// Token: 0x06001C1A RID: 7194 RVA: 0x0006A1DC File Offset: 0x000683DC
public override object GetValue(object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
{
throw new NotSupportedException();
}
// Token: 0x06001C1B RID: 7195 RVA: 0x0006A1E4 File Offset: 0x000683E4
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
{
throw new NotSupportedException();
}
// Token: 0x06001C1C RID: 7196 RVA: 0x0006A1EC File Offset: 0x000683EC
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001C1D RID: 7197 RVA: 0x0006A1F4 File Offset: 0x000683F4
public override object[] GetCustomAttributes(bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x06001C1E RID: 7198 RVA: 0x0006A1FC File Offset: 0x000683FC
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
throw new NotSupportedException();
}
// Token: 0x0400097A RID: 2426
private MonoGenericClass instantiation;
// Token: 0x0400097B RID: 2427
private PropertyInfo prop;
}
}
@@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>The PropertyToken struct is an opaque representation of the Token returned by the metadata to represent a property.</summary>
// Token: 0x02000215 RID: 533
[ComVisible(true)]
[Serializable]
public struct PropertyToken
{
// Token: 0x06001C1F RID: 7199 RVA: 0x0006A204 File Offset: 0x00068404
internal PropertyToken(int val)
{
this.tokValue = val;
}
/// <summary>Checks if the given object is an instance of PropertyToken and is equal to this instance.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of PropertyToken and equals the current instance; otherwise, false.</returns>
/// <param name="obj">The object to this object. </param>
// Token: 0x06001C21 RID: 7201 RVA: 0x0006A22C File Offset: 0x0006842C
public override bool Equals(object obj)
{
bool flag = obj is PropertyToken;
if (flag)
{
PropertyToken propertyToken = (PropertyToken)obj;
flag = this.tokValue == propertyToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.PropertyToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.PropertyToken" /> to compare to the current instance.</param>
// Token: 0x06001C22 RID: 7202 RVA: 0x0006A264 File Offset: 0x00068464
public bool Equals(PropertyToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Generates the hash code for this property.</summary>
/// <returns>Returns the hash code for this property.</returns>
// Token: 0x06001C23 RID: 7203 RVA: 0x0006A278 File Offset: 0x00068478
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for this property.</summary>
/// <returns>Read-only. Retrieves the metadata token for this instance.</returns>
// Token: 0x17000512 RID: 1298
// (get) Token: 0x06001C24 RID: 7204 RVA: 0x0006A280 File Offset: 0x00068480
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.PropertyToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.PropertyToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.PropertyToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001C25 RID: 7205 RVA: 0x0006A288 File Offset: 0x00068488
public static bool operator ==(PropertyToken a, PropertyToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.PropertyToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.PropertyToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.PropertyToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001C26 RID: 7206 RVA: 0x0006A29C File Offset: 0x0006849C
public static bool operator !=(PropertyToken a, PropertyToken b)
{
return !object.Equals(a, b);
}
// Token: 0x0400097C RID: 2428
internal int tokValue;
/// <summary>The default PropertyToken with <see cref="P:System.Reflection.Emit.PropertyToken.Token" /> value 0.</summary>
// Token: 0x0400097D RID: 2429
public static readonly PropertyToken Empty = default(PropertyToken);
}
}
@@ -0,0 +1,22 @@
using System;
using System.Security.Permissions;
namespace System.Reflection.Emit
{
// Token: 0x020001DD RID: 477
internal struct RefEmitPermissionSet
{
// Token: 0x06001899 RID: 6297 RVA: 0x0005E2A8 File Offset: 0x0005C4A8
public RefEmitPermissionSet(SecurityAction action, string pset)
{
this.action = action;
this.pset = pset;
}
// Token: 0x04000739 RID: 1849
public SecurityAction action;
// Token: 0x0400073A RID: 1850
public string pset;
}
}
@@ -0,0 +1,23 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x02000200 RID: 512
internal struct SequencePoint
{
// Token: 0x04000804 RID: 2052
public int Offset;
// Token: 0x04000805 RID: 2053
public int Line;
// Token: 0x04000806 RID: 2054
public int Col;
// Token: 0x04000807 RID: 2055
public int EndLine;
// Token: 0x04000808 RID: 2056
public int EndCol;
}
}
@@ -0,0 +1,155 @@
using System;
using System.Diagnostics.SymbolStore;
namespace System.Reflection.Emit
{
// Token: 0x020001FF RID: 511
internal class SequencePointList
{
// Token: 0x06001AD7 RID: 6871 RVA: 0x00065330 File Offset: 0x00063530
public SequencePointList(ISymbolDocumentWriter doc)
{
this.doc = doc;
}
// Token: 0x170004BE RID: 1214
// (get) Token: 0x06001AD8 RID: 6872 RVA: 0x00065340 File Offset: 0x00063540
public ISymbolDocumentWriter Document
{
get
{
return this.doc;
}
}
// Token: 0x06001AD9 RID: 6873 RVA: 0x00065348 File Offset: 0x00063548
public int[] GetOffsets()
{
int[] array = new int[this.count];
for (int i = 0; i < this.count; i++)
{
array[i] = this.points[i].Offset;
}
return array;
}
// Token: 0x06001ADA RID: 6874 RVA: 0x00065390 File Offset: 0x00063590
public int[] GetLines()
{
int[] array = new int[this.count];
for (int i = 0; i < this.count; i++)
{
array[i] = this.points[i].Line;
}
return array;
}
// Token: 0x06001ADB RID: 6875 RVA: 0x000653D8 File Offset: 0x000635D8
public int[] GetColumns()
{
int[] array = new int[this.count];
for (int i = 0; i < this.count; i++)
{
array[i] = this.points[i].Col;
}
return array;
}
// Token: 0x06001ADC RID: 6876 RVA: 0x00065420 File Offset: 0x00063620
public int[] GetEndLines()
{
int[] array = new int[this.count];
for (int i = 0; i < this.count; i++)
{
array[i] = this.points[i].EndLine;
}
return array;
}
// Token: 0x06001ADD RID: 6877 RVA: 0x00065468 File Offset: 0x00063668
public int[] GetEndColumns()
{
int[] array = new int[this.count];
for (int i = 0; i < this.count; i++)
{
array[i] = this.points[i].EndCol;
}
return array;
}
// Token: 0x170004BF RID: 1215
// (get) Token: 0x06001ADE RID: 6878 RVA: 0x000654B0 File Offset: 0x000636B0
public int StartLine
{
get
{
return this.points[0].Line;
}
}
// Token: 0x170004C0 RID: 1216
// (get) Token: 0x06001ADF RID: 6879 RVA: 0x000654C4 File Offset: 0x000636C4
public int EndLine
{
get
{
return this.points[this.count - 1].Line;
}
}
// Token: 0x170004C1 RID: 1217
// (get) Token: 0x06001AE0 RID: 6880 RVA: 0x000654E0 File Offset: 0x000636E0
public int StartColumn
{
get
{
return this.points[0].Col;
}
}
// Token: 0x170004C2 RID: 1218
// (get) Token: 0x06001AE1 RID: 6881 RVA: 0x000654F4 File Offset: 0x000636F4
public int EndColumn
{
get
{
return this.points[this.count - 1].Col;
}
}
// Token: 0x06001AE2 RID: 6882 RVA: 0x00065510 File Offset: 0x00063710
public void AddSequencePoint(int offset, int line, int col, int endLine, int endCol)
{
SequencePoint sequencePoint = default(SequencePoint);
sequencePoint.Offset = offset;
sequencePoint.Line = line;
sequencePoint.Col = col;
sequencePoint.EndLine = endLine;
sequencePoint.EndCol = endCol;
if (this.points == null)
{
this.points = new SequencePoint[10];
}
else if (this.count >= this.points.Length)
{
SequencePoint[] array = new SequencePoint[this.count + 10];
Array.Copy(this.points, array, this.points.Length);
this.points = array;
}
this.points[this.count] = sequencePoint;
this.count++;
}
// Token: 0x04000800 RID: 2048
private const int arrayGrow = 10;
// Token: 0x04000801 RID: 2049
private ISymbolDocumentWriter doc;
// Token: 0x04000802 RID: 2050
private SequencePoint[] points;
// Token: 0x04000803 RID: 2051
private int count;
}
}
@@ -0,0 +1,604 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Provides methods for building signatures.</summary>
// Token: 0x02000216 RID: 534
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_SignatureHelper))]
[ComVisible(true)]
public sealed class SignatureHelper : _SignatureHelper
{
// Token: 0x06001C27 RID: 7207 RVA: 0x0006A2B4 File Offset: 0x000684B4
internal SignatureHelper(ModuleBuilder module, SignatureHelper.SignatureHelperType type)
{
this.type = type;
this.module = module;
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C28 RID: 7208 RVA: 0x0006A2CC File Offset: 0x000684CC
void _SignatureHelper.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C29 RID: 7209 RVA: 0x0006A2D4 File Offset: 0x000684D4
void _SignatureHelper.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C2A RID: 7210 RVA: 0x0006A2DC File Offset: 0x000684DC
void _SignatureHelper.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C2B RID: 7211 RVA: 0x0006A2E4 File Offset: 0x000684E4
void _SignatureHelper.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
/// <summary>Returns a signature helper for a field.</summary>
/// <returns>The SignatureHelper object for a field.</returns>
/// <param name="mod">The dynamic module that contains the field for which the SignatureHelper is requested. </param>
// Token: 0x06001C2C RID: 7212 RVA: 0x0006A2EC File Offset: 0x000684EC
public static SignatureHelper GetFieldSigHelper(Module mod)
{
if (mod != null && !(mod is ModuleBuilder))
{
throw new ArgumentException("ModuleBuilder is expected");
}
return new SignatureHelper((ModuleBuilder)mod, SignatureHelper.SignatureHelperType.HELPER_FIELD);
}
/// <summary>Returns a signature helper for a local variable.</summary>
/// <returns>The SignatureHelper object for a local variable.</returns>
/// <param name="mod">The dynamic module that contains the local variable for which the SignatureHelper is requested. </param>
// Token: 0x06001C2D RID: 7213 RVA: 0x0006A324 File Offset: 0x00068524
public static SignatureHelper GetLocalVarSigHelper(Module mod)
{
if (mod != null && !(mod is ModuleBuilder))
{
throw new ArgumentException("ModuleBuilder is expected");
}
return new SignatureHelper((ModuleBuilder)mod, SignatureHelper.SignatureHelperType.HELPER_LOCAL);
}
/// <summary>Returns a signature helper for a local variable.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.SignatureHelper" /> for a local variable.</returns>
// Token: 0x06001C2E RID: 7214 RVA: 0x0006A35C File Offset: 0x0006855C
public static SignatureHelper GetLocalVarSigHelper()
{
return new SignatureHelper(null, SignatureHelper.SignatureHelperType.HELPER_LOCAL);
}
/// <summary>Returns a signature helper for a method given the method's calling convention and return type.</summary>
/// <returns>The SignatureHelper object for a method.</returns>
/// <param name="callingConvention">The calling convention of the method. </param>
/// <param name="returnType">The return type of the method, or null for a void return type (Sub procedure in Visual Basic). </param>
// Token: 0x06001C2F RID: 7215 RVA: 0x0006A368 File Offset: 0x00068568
public static SignatureHelper GetMethodSigHelper(CallingConventions callingConvention, Type returnType)
{
return SignatureHelper.GetMethodSigHelper(null, callingConvention, (CallingConvention)0, returnType, null);
}
/// <summary>Returns a signature helper for a method given the method's unmanaged calling convention and return type.</summary>
/// <returns>The SignatureHelper object for a method.</returns>
/// <param name="unmanagedCallingConvention">The unmanaged calling convention of the method. </param>
/// <param name="returnType">The return type of the method, or null for a void return type (Sub procedure in Visual Basic). </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="unmanagedCallConv" /> is an unknown unmanaged calling convention.</exception>
// Token: 0x06001C30 RID: 7216 RVA: 0x0006A374 File Offset: 0x00068574
public static SignatureHelper GetMethodSigHelper(CallingConvention unmanagedCallingConvention, Type returnType)
{
return SignatureHelper.GetMethodSigHelper(null, CallingConventions.Standard, unmanagedCallingConvention, returnType, null);
}
/// <summary>Returns a signature helper for a method given the method's module, calling convention, and return type.</summary>
/// <returns>The SignatureHelper object for a method.</returns>
/// <param name="mod">The <see cref="T:System.Reflection.Emit.ModuleBuilder" /> that contains the method for which the SignatureHelper is requested. </param>
/// <param name="callingConvention">The calling convention of the method. </param>
/// <param name="returnType">The return type of the method, or null for a void return type (Sub procedure in Visual Basic). </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mod" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="mod" /> is not a <see cref="T:System.Reflection.Emit.ModuleBuilder" />.</exception>
// Token: 0x06001C31 RID: 7217 RVA: 0x0006A380 File Offset: 0x00068580
public static SignatureHelper GetMethodSigHelper(Module mod, CallingConventions callingConvention, Type returnType)
{
return SignatureHelper.GetMethodSigHelper(mod, callingConvention, (CallingConvention)0, returnType, null);
}
/// <summary>Returns a signature helper for a method given the method's module, unmanaged calling convention, and return type.</summary>
/// <returns>The SignatureHelper object for a method.</returns>
/// <param name="mod">The <see cref="T:System.Reflection.Emit.ModuleBuilder" /> that contains the method for which the SignatureHelper is requested. </param>
/// <param name="unmanagedCallConv">The unmanaged calling convention of the method. </param>
/// <param name="returnType">The return type of the method, or null for a void return type (Sub procedure in Visual Basic). </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mod" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="mod" /> is not a <see cref="T:System.Reflection.Emit.ModuleBuilder" />.-or-<paramref name="unmanagedCallConv" /> is an unknown unmanaged calling convention.</exception>
// Token: 0x06001C32 RID: 7218 RVA: 0x0006A38C File Offset: 0x0006858C
public static SignatureHelper GetMethodSigHelper(Module mod, CallingConvention unmanagedCallConv, Type returnType)
{
return SignatureHelper.GetMethodSigHelper(mod, CallingConventions.Standard, unmanagedCallConv, returnType, null);
}
/// <summary>Returns a signature helper for a method with a standard calling convention, given the method's module, return type, and argument types.</summary>
/// <returns>The SignatureHelper object for a method.</returns>
/// <param name="mod">The <see cref="T:System.Reflection.Emit.ModuleBuilder" /> that contains the method for which the SignatureHelper is requested. </param>
/// <param name="returnType">The return type of the method, or null for a void return type (Sub procedure in Visual Basic). </param>
/// <param name="parameterTypes">The types of the arguments of the method, or null if the method has no arguments. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mod" /> is null.-or-An element of <paramref name="parameterTypes" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="mod" /> is not a <see cref="T:System.Reflection.Emit.ModuleBuilder" />.</exception>
// Token: 0x06001C33 RID: 7219 RVA: 0x0006A398 File Offset: 0x00068598
public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes)
{
return SignatureHelper.GetMethodSigHelper(mod, CallingConventions.Standard, (CallingConvention)0, returnType, parameterTypes);
}
/// <summary>Returns a signature helper for a property, given the dynamic module that contains the property, the property type, and the property arguments.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.SignatureHelper" /> object for a property.</returns>
/// <param name="mod">The <see cref="T:System.Reflection.Emit.ModuleBuilder" /> that contains the property for which the <see cref="T:System.Reflection.Emit.SignatureHelper" /> is requested.</param>
/// <param name="returnType">The property type.</param>
/// <param name="parameterTypes">The argument types, or null if the property has no arguments.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mod" /> is null.-or-An element of <paramref name="parameterTypes" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="mod" /> is not a <see cref="T:System.Reflection.Emit.ModuleBuilder" />.</exception>
// Token: 0x06001C34 RID: 7220 RVA: 0x0006A3A4 File Offset: 0x000685A4
[MonoTODO("Not implemented")]
public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes)
{
throw new NotImplementedException();
}
// Token: 0x06001C35 RID: 7221 RVA: 0x0006A3AC File Offset: 0x000685AC
private static int AppendArray(ref Type[] array, Type t)
{
if (array != null)
{
Type[] array2 = new Type[array.Length + 1];
Array.Copy(array, array2, array.Length);
array2[array.Length] = t;
array = array2;
return array.Length - 1;
}
array = new Type[1];
array[0] = t;
return 0;
}
// Token: 0x06001C36 RID: 7222 RVA: 0x0006A3F8 File Offset: 0x000685F8
private static void AppendArrayAt(ref Type[][] array, Type[] t, int pos)
{
int num = Math.Max(pos, (array != null) ? array.Length : 0);
Type[][] array2 = new Type[num + 1][];
if (array != null)
{
Array.Copy(array, array2, num);
}
array2[pos] = t;
array = array2;
}
// Token: 0x06001C37 RID: 7223 RVA: 0x0006A440 File Offset: 0x00068640
private static void ValidateParameterModifiers(string name, Type[] parameter_modifiers)
{
foreach (Type type in parameter_modifiers)
{
if (type == null)
{
throw new ArgumentNullException(name);
}
if (type.IsArray)
{
throw new ArgumentException(Locale.GetText("Array type not permitted"), name);
}
if (type.ContainsGenericParameters)
{
throw new ArgumentException(Locale.GetText("Open Generic Type not permitted"), name);
}
}
}
// Token: 0x06001C38 RID: 7224 RVA: 0x0006A4AC File Offset: 0x000686AC
private static void ValidateCustomModifier(int n, Type[][] custom_modifiers, string name)
{
if (custom_modifiers == null)
{
return;
}
if (custom_modifiers.Length != n)
{
throw new ArgumentException(Locale.GetText(string.Format("Custom modifiers length `{0}' does not match the size of the arguments", new object[0])));
}
foreach (Type[] array in custom_modifiers)
{
if (array != null)
{
SignatureHelper.ValidateParameterModifiers(name, array);
}
}
}
// Token: 0x06001C39 RID: 7225 RVA: 0x0006A510 File Offset: 0x00068710
private static Exception MissingFeature()
{
throw new NotImplementedException("Mono does not currently support setting modOpt/modReq through SignatureHelper");
}
/// <summary>Adds a set of arguments to the signature, with the specified custom modifiers.</summary>
/// <param name="arguments">The types of the arguments to be added.</param>
/// <param name="requiredCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding argument, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If a particular argument has no required custom modifiers, specify null instead of an array of types. If none of the arguments have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="optionalCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding argument, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If a particular argument has no optional custom modifiers, specify null instead of an array of types. If none of the arguments have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.ArgumentNullException">An element of <paramref name="arguments" /> is null. -or-One of the specified custom modifiers is null. (However, null can be specified for the array of custom modifiers for any argument.)</exception>
/// <exception cref="T:System.ArgumentException">The signature has already been finished. -or-One of the specified custom modifiers is an array type.-or-One of the specified custom modifiers is an open generic type. That is, the <see cref="P:System.Type.ContainsGenericParameters" /> property is true for the custom modifier. -or-The size of <paramref name="requiredCustomModifiers" /> or <paramref name="optionalCustomModifiers" /> does not equal the size of <paramref name="arguments" />.</exception>
// Token: 0x06001C3A RID: 7226 RVA: 0x0006A51C File Offset: 0x0006871C
[MonoTODO("Currently we ignore requiredCustomModifiers and optionalCustomModifiers")]
public void AddArguments(Type[] arguments, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers)
{
if (arguments == null)
{
throw new ArgumentNullException("arguments");
}
if (requiredCustomModifiers != null || optionalCustomModifiers != null)
{
throw SignatureHelper.MissingFeature();
}
SignatureHelper.ValidateCustomModifier(arguments.Length, requiredCustomModifiers, "requiredCustomModifiers");
SignatureHelper.ValidateCustomModifier(arguments.Length, optionalCustomModifiers, "optionalCustomModifiers");
for (int i = 0; i < arguments.Length; i++)
{
this.AddArgument(arguments[i], (requiredCustomModifiers == null) ? null : requiredCustomModifiers[i], (optionalCustomModifiers == null) ? null : optionalCustomModifiers[i]);
}
}
/// <summary>Adds an argument of the specified type to the signature, specifying whether the argument is pinned.</summary>
/// <param name="argument">The argument type.</param>
/// <param name="pinned">true if the argument is pinned; otherwise, false.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="argument" /> is null.</exception>
// Token: 0x06001C3B RID: 7227 RVA: 0x0006A5A4 File Offset: 0x000687A4
[MonoTODO("pinned is ignored")]
public void AddArgument(Type argument, bool pinned)
{
this.AddArgument(argument);
}
/// <summary>Adds an argument to the signature, with the specified custom modifiers.</summary>
/// <param name="argument">The argument type.</param>
/// <param name="requiredCustomModifiers">An array of types representing the required custom modifiers for the argument, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the argument has no required custom modifiers, specify null.</param>
/// <param name="optionalCustomModifiers">An array of types representing the optional custom modifiers for the argument, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the argument has no optional custom modifiers, specify null.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="argument" /> is null. -or-An element of <paramref name="requiredCustomModifiers" /> or <paramref name="optionalCustomModifiers" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">The signature has already been finished. -or-One of the specified custom modifiers is an array type.-or-One of the specified custom modifiers is an open generic type. That is, the <see cref="P:System.Type.ContainsGenericParameters" /> property is true for the custom modifier.</exception>
// Token: 0x06001C3C RID: 7228 RVA: 0x0006A5B0 File Offset: 0x000687B0
public void AddArgument(Type argument, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers)
{
if (argument == null)
{
throw new ArgumentNullException("argument");
}
if (requiredCustomModifiers != null)
{
SignatureHelper.ValidateParameterModifiers("requiredCustomModifiers", requiredCustomModifiers);
}
if (optionalCustomModifiers != null)
{
SignatureHelper.ValidateParameterModifiers("optionalCustomModifiers", optionalCustomModifiers);
}
int num = SignatureHelper.AppendArray(ref this.arguments, argument);
if (requiredCustomModifiers != null)
{
SignatureHelper.AppendArrayAt(ref this.modreqs, requiredCustomModifiers, num);
}
if (optionalCustomModifiers != null)
{
SignatureHelper.AppendArrayAt(ref this.modopts, optionalCustomModifiers, num);
}
}
/// <summary>Returns a signature helper for a property, given the dynamic module that contains the property, the property type, the property arguments, and custom modifiers for the return type and arguments.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.SignatureHelper" /> object for a property.</returns>
/// <param name="mod">The <see cref="T:System.Reflection.Emit.ModuleBuilder" /> that contains the property for which the <see cref="T:System.Reflection.Emit.SignatureHelper" /> is requested.</param>
/// <param name="returnType">The property type.</param>
/// <param name="requiredReturnTypeCustomModifiers">An array of types representing the required custom modifiers for the return type, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the return type has no required custom modifiers, specify null.</param>
/// <param name="optionalReturnTypeCustomModifiers">An array of types representing the optional custom modifiers for the return type, such as <see cref="T:System.Runtime.CompilerServices.IsConst" /> or <see cref="T:System.Runtime.CompilerServices.IsBoxed" />. If the return type has no optional custom modifiers, specify null.</param>
/// <param name="parameterTypes">The types of the property's arguments, or null if the property has no arguments.</param>
/// <param name="requiredParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding argument of the property. If a particular argument has no required custom modifiers, specify null instead of an array of types. If the property has no arguments, or if none of the arguments have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="optionalParameterTypeCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding argument of the property. If a particular argument has no optional custom modifiers, specify null instead of an array of types. If the property has no arguments, or if none of the arguments have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="mod" /> is null.-or-An element of <paramref name="parameterTypes" /> is null. -or-One of the specified custom modifiers is null. (However, null can be specified for the array of custom modifiers for any argument.)</exception>
/// <exception cref="T:System.ArgumentException">The signature has already been finished. -or-<paramref name="mod" /> is not a <see cref="T:System.Reflection.Emit.ModuleBuilder" />.-or-One of the specified custom modifiers is an array type.-or-One of the specified custom modifiers is an open generic type. That is, the <see cref="P:System.Type.ContainsGenericParameters" /> property is true for the custom modifier.-or-The size of <paramref name="requiredParameterTypeCustomModifiers" /> or <paramref name="optionalParameterTypeCustomModifiers" /> does not equal the size of <paramref name="parameterTypes" />.</exception>
// Token: 0x06001C3D RID: 7229 RVA: 0x0006A624 File Offset: 0x00068824
[MonoTODO("Not implemented")]
public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
{
throw new NotImplementedException();
}
/// <summary>Adds an argument to the signature.</summary>
/// <param name="clsArgument">The type of the argument. </param>
/// <exception cref="T:System.ArgumentException">The signature has already been finished. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="clsArgument" /> is null.</exception>
// Token: 0x06001C3E RID: 7230 RVA: 0x0006A62C File Offset: 0x0006882C
public void AddArgument(Type clsArgument)
{
if (clsArgument == null)
{
throw new ArgumentNullException("clsArgument");
}
SignatureHelper.AppendArray(ref this.arguments, clsArgument);
}
/// <summary>Marks the end of a vararg fixed part. This is only used if the caller is creating a vararg signature call site.</summary>
// Token: 0x06001C3F RID: 7231 RVA: 0x0006A64C File Offset: 0x0006884C
[MonoTODO("Not implemented")]
public void AddSentinel()
{
throw new NotImplementedException();
}
// Token: 0x06001C40 RID: 7232 RVA: 0x0006A654 File Offset: 0x00068854
private static bool CompareOK(Type[][] one, Type[][] two)
{
if (one == null)
{
return two == null;
}
if (two == null)
{
return false;
}
if (one.Length != two.Length)
{
return false;
}
int i = 0;
while (i < one.Length)
{
Type[] array = one[i];
Type[] array2 = two[i];
if (array == null)
{
if (array2 != null)
{
goto IL_52;
}
}
else
{
if (array2 == null)
{
return false;
}
goto IL_52;
}
IL_AB:
i++;
continue;
IL_52:
if (array.Length != array2.Length)
{
return false;
}
for (int j = 0; j < array.Length; j++)
{
Type type = array[j];
Type type2 = array2[j];
if (type == null)
{
if (type2 != null)
{
return false;
}
}
else
{
if (type2 == null)
{
return false;
}
if (!type.Equals(type2))
{
return false;
}
}
}
goto IL_AB;
}
return true;
}
/// <summary>Checks if this instance is equal to the given object.</summary>
/// <returns>true if the given object is a SignatureHelper and represents the same signature; otherwise, false.</returns>
/// <param name="obj">The object with which this instance should be compared. </param>
// Token: 0x06001C41 RID: 7233 RVA: 0x0006A71C File Offset: 0x0006891C
public override bool Equals(object obj)
{
SignatureHelper signatureHelper = obj as SignatureHelper;
if (signatureHelper == null)
{
return false;
}
if (signatureHelper.module != this.module || signatureHelper.returnType != this.returnType || signatureHelper.callConv != this.callConv || signatureHelper.unmanagedCallConv != this.unmanagedCallConv)
{
return false;
}
if (this.arguments != null)
{
if (signatureHelper.arguments == null)
{
return false;
}
if (this.arguments.Length != signatureHelper.arguments.Length)
{
return false;
}
for (int i = 0; i < this.arguments.Length; i++)
{
if (!signatureHelper.arguments[i].Equals(this.arguments[i]))
{
return false;
}
}
}
else if (signatureHelper.arguments != null)
{
return false;
}
return SignatureHelper.CompareOK(signatureHelper.modreqs, this.modreqs) && SignatureHelper.CompareOK(signatureHelper.modopts, this.modopts);
}
/// <summary>Creates and returns a hash code for this instance.</summary>
/// <returns>Returns the hash code based on the name.</returns>
// Token: 0x06001C42 RID: 7234 RVA: 0x0006A820 File Offset: 0x00068A20
public override int GetHashCode()
{
return 0;
}
// Token: 0x06001C43 RID: 7235
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern byte[] get_signature_local();
// Token: 0x06001C44 RID: 7236
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern byte[] get_signature_field();
/// <summary>Adds the end token to the signature and marks the signature as finished, so no further tokens can be added.</summary>
/// <returns>Returns a byte array made up of the full signature.</returns>
// Token: 0x06001C45 RID: 7237 RVA: 0x0006A824 File Offset: 0x00068A24
public byte[] GetSignature()
{
SignatureHelper.SignatureHelperType signatureHelperType = this.type;
if (signatureHelperType == SignatureHelper.SignatureHelperType.HELPER_FIELD)
{
return this.get_signature_field();
}
if (signatureHelperType != SignatureHelper.SignatureHelperType.HELPER_LOCAL)
{
throw new NotImplementedException();
}
return this.get_signature_local();
}
/// <summary>Returns a string representing the signature arguments.</summary>
/// <returns>Returns a string representing the arguments of this signature.</returns>
// Token: 0x06001C46 RID: 7238 RVA: 0x0006A860 File Offset: 0x00068A60
public override string ToString()
{
return "SignatureHelper";
}
// Token: 0x06001C47 RID: 7239 RVA: 0x0006A868 File Offset: 0x00068A68
internal static SignatureHelper GetMethodSigHelper(Module mod, CallingConventions callingConvention, CallingConvention unmanagedCallingConvention, Type returnType, Type[] parameters)
{
if (mod != null && !(mod is ModuleBuilder))
{
throw new ArgumentException("ModuleBuilder is expected");
}
if (returnType == null)
{
returnType = typeof(void);
}
if (returnType.IsUserType)
{
throw new NotSupportedException("User defined subclasses of System.Type are not yet supported.");
}
if (parameters != null)
{
for (int i = 0; i < parameters.Length; i++)
{
if (parameters[i].IsUserType)
{
throw new NotSupportedException("User defined subclasses of System.Type are not yet supported.");
}
}
}
SignatureHelper signatureHelper = new SignatureHelper((ModuleBuilder)mod, SignatureHelper.SignatureHelperType.HELPER_METHOD);
signatureHelper.returnType = returnType;
signatureHelper.callConv = callingConvention;
signatureHelper.unmanagedCallConv = unmanagedCallingConvention;
if (parameters != null)
{
signatureHelper.arguments = new Type[parameters.Length];
for (int j = 0; j < parameters.Length; j++)
{
signatureHelper.arguments[j] = parameters[j];
}
}
return signatureHelper;
}
// Token: 0x0400097E RID: 2430
private ModuleBuilder module;
// Token: 0x0400097F RID: 2431
private Type[] arguments;
// Token: 0x04000980 RID: 2432
private SignatureHelper.SignatureHelperType type;
// Token: 0x04000981 RID: 2433
private Type returnType;
// Token: 0x04000982 RID: 2434
private CallingConventions callConv;
// Token: 0x04000983 RID: 2435
private CallingConvention unmanagedCallConv;
// Token: 0x04000984 RID: 2436
private Type[][] modreqs;
// Token: 0x04000985 RID: 2437
private Type[][] modopts;
// Token: 0x02000217 RID: 535
internal enum SignatureHelperType
{
// Token: 0x04000987 RID: 2439
HELPER_FIELD,
// Token: 0x04000988 RID: 2440
HELPER_LOCAL,
// Token: 0x04000989 RID: 2441
HELPER_METHOD,
// Token: 0x0400098A RID: 2442
HELPER_PROPERTY
}
}
}
@@ -0,0 +1,88 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents the Token returned by the metadata to represent a signature.</summary>
// Token: 0x02000218 RID: 536
[ComVisible(true)]
public struct SignatureToken
{
// Token: 0x06001C48 RID: 7240 RVA: 0x0006A948 File Offset: 0x00068B48
internal SignatureToken(int val)
{
this.tokValue = val;
}
/// <summary>Checks if the given object is an instance of SignatureToken and is equal to this instance.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of SignatureToken and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare with this SignatureToken. </param>
// Token: 0x06001C4A RID: 7242 RVA: 0x0006A970 File Offset: 0x00068B70
public override bool Equals(object obj)
{
bool flag = obj is SignatureToken;
if (flag)
{
SignatureToken signatureToken = (SignatureToken)obj;
flag = this.tokValue == signatureToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.SignatureToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.SignatureToken" /> to compare to the current instance.</param>
// Token: 0x06001C4B RID: 7243 RVA: 0x0006A9A8 File Offset: 0x00068BA8
public bool Equals(SignatureToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Generates the hash code for this signature.</summary>
/// <returns>Returns the hash code for this signature.</returns>
// Token: 0x06001C4C RID: 7244 RVA: 0x0006A9BC File Offset: 0x00068BBC
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for the local variable signature for this method.</summary>
/// <returns>Read-only. Retrieves the metadata token of this signature.</returns>
// Token: 0x17000513 RID: 1299
// (get) Token: 0x06001C4D RID: 7245 RVA: 0x0006A9C4 File Offset: 0x00068BC4
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.SignatureToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.SignatureToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.SignatureToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001C4E RID: 7246 RVA: 0x0006A9CC File Offset: 0x00068BCC
public static bool operator ==(SignatureToken a, SignatureToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.SignatureToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.SignatureToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.SignatureToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001C4F RID: 7247 RVA: 0x0006A9E0 File Offset: 0x00068BE0
public static bool operator !=(SignatureToken a, SignatureToken b)
{
return !object.Equals(a, b);
}
// Token: 0x0400098B RID: 2443
internal int tokValue;
/// <summary>The default SignatureToken with <see cref="P:System.Reflection.Emit.SignatureToken.Token" /> value 0.</summary>
// Token: 0x0400098C RID: 2444
public static readonly SignatureToken Empty = default(SignatureToken);
}
}
@@ -0,0 +1,100 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Describes how values are pushed onto a stack or popped off a stack.</summary>
// Token: 0x02000219 RID: 537
[ComVisible(true)]
[Serializable]
public enum StackBehaviour
{
/// <summary>No values are popped off the stack.</summary>
// Token: 0x0400098E RID: 2446
Pop0,
/// <summary>Pops one value off the stack.</summary>
// Token: 0x0400098F RID: 2447
Pop1,
/// <summary>Pops 1 value off the stack for the first operand, and 1 value of the stack for the second operand.</summary>
// Token: 0x04000990 RID: 2448
Pop1_pop1,
/// <summary>Pops a 32-bit integer off the stack.</summary>
// Token: 0x04000991 RID: 2449
Popi,
/// <summary>Pops a 32-bit integer off the stack for the first operand, and a value off the stack for the second operand.</summary>
// Token: 0x04000992 RID: 2450
Popi_pop1,
/// <summary>Pops a 32-bit integer off the stack for the first operand, and a 32-bit integer off the stack for the second operand.</summary>
// Token: 0x04000993 RID: 2451
Popi_popi,
/// <summary>Pops a 32-bit integer off the stack for the first operand, and a 64-bit integer off the stack for the second operand.</summary>
// Token: 0x04000994 RID: 2452
Popi_popi8,
/// <summary>Pops a 32-bit integer off the stack for the first operand, a 32-bit integer off the stack for the second operand, and a 32-bit integer off the stack for the third operand.</summary>
// Token: 0x04000995 RID: 2453
Popi_popi_popi,
/// <summary>Pops a 32-bit integer off the stack for the first operand, and a 32-bit floating point number off the stack for the second operand.</summary>
// Token: 0x04000996 RID: 2454
Popi_popr4,
/// <summary>Pops a 32-bit integer off the stack for the first operand, and a 64-bit floating point number off the stack for the second operand.</summary>
// Token: 0x04000997 RID: 2455
Popi_popr8,
/// <summary>Pops a reference off the stack.</summary>
// Token: 0x04000998 RID: 2456
Popref,
/// <summary>Pops a reference off the stack for the first operand, and a value off the stack for the second operand.</summary>
// Token: 0x04000999 RID: 2457
Popref_pop1,
/// <summary>Pops a reference off the stack for the first operand, and a 32-bit integer off the stack for the second operand.</summary>
// Token: 0x0400099A RID: 2458
Popref_popi,
/// <summary>Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a value off the stack for the third operand.</summary>
// Token: 0x0400099B RID: 2459
Popref_popi_popi,
/// <summary>Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 64-bit integer off the stack for the third operand.</summary>
// Token: 0x0400099C RID: 2460
Popref_popi_popi8,
/// <summary>Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 32-bit integer off the stack for the third operand.</summary>
// Token: 0x0400099D RID: 2461
Popref_popi_popr4,
/// <summary>Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 64-bit floating point number off the stack for the third operand.</summary>
// Token: 0x0400099E RID: 2462
Popref_popi_popr8,
/// <summary>Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a reference off the stack for the third operand.</summary>
// Token: 0x0400099F RID: 2463
Popref_popi_popref,
/// <summary>No values are pushed onto the stack.</summary>
// Token: 0x040009A0 RID: 2464
Push0,
/// <summary>Pushes one value onto the stack.</summary>
// Token: 0x040009A1 RID: 2465
Push1,
/// <summary>Pushes 1 value onto the stack for the first operand, and 1 value onto the stack for the second operand.</summary>
// Token: 0x040009A2 RID: 2466
Push1_push1,
/// <summary>Pushes a 32-bit integer onto the stack.</summary>
// Token: 0x040009A3 RID: 2467
Pushi,
/// <summary>Pushes a 64-bit integer onto the stack.</summary>
// Token: 0x040009A4 RID: 2468
Pushi8,
/// <summary>Pushes a 32-bit floating point number onto the stack.</summary>
// Token: 0x040009A5 RID: 2469
Pushr4,
/// <summary>Pushes a 64-bit floating point number onto the stack.</summary>
// Token: 0x040009A6 RID: 2470
Pushr8,
/// <summary>Pushes a reference onto the stack.</summary>
// Token: 0x040009A7 RID: 2471
Pushref,
/// <summary>Pops a variable off the stack.</summary>
// Token: 0x040009A8 RID: 2472
Varpop,
/// <summary>Pushes a variable onto the stack.</summary>
// Token: 0x040009A9 RID: 2473
Varpush,
/// <summary>Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 32-bit integer off the stack for the third operand.</summary>
// Token: 0x040009AA RID: 2474
Popref_popi_pop1
}
}
@@ -0,0 +1,85 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents a token that represents a string.</summary>
// Token: 0x0200021A RID: 538
[ComVisible(true)]
[Serializable]
public struct StringToken
{
// Token: 0x06001C50 RID: 7248 RVA: 0x0006A9F8 File Offset: 0x00068BF8
internal StringToken(int val)
{
this.tokValue = val;
}
/// <summary>Checks if the given object is an instance of StringToken and is equal to this instance.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of StringToken and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare with this StringToken. </param>
// Token: 0x06001C52 RID: 7250 RVA: 0x0006AA08 File Offset: 0x00068C08
public override bool Equals(object obj)
{
bool flag = obj is StringToken;
if (flag)
{
StringToken stringToken = (StringToken)obj;
flag = this.tokValue == stringToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.StringToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.StringToken" /> to compare to the current instance.</param>
// Token: 0x06001C53 RID: 7251 RVA: 0x0006AA40 File Offset: 0x00068C40
public bool Equals(StringToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Returns the hash code for this string.</summary>
/// <returns>Returns the underlying string token.</returns>
// Token: 0x06001C54 RID: 7252 RVA: 0x0006AA54 File Offset: 0x00068C54
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for this string.</summary>
/// <returns>Read-only. Retrieves the metadata token of this string.</returns>
// Token: 0x17000514 RID: 1300
// (get) Token: 0x06001C55 RID: 7253 RVA: 0x0006AA5C File Offset: 0x00068C5C
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.StringToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.StringToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.StringToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001C56 RID: 7254 RVA: 0x0006AA64 File Offset: 0x00068C64
public static bool operator ==(StringToken a, StringToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.StringToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.StringToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.StringToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001C57 RID: 7255 RVA: 0x0006AA78 File Offset: 0x00068C78
public static bool operator !=(StringToken a, StringToken b)
{
return !object.Equals(a, b);
}
// Token: 0x040009AB RID: 2475
internal int tokValue;
}
}
@@ -0,0 +1,20 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001FB RID: 507
internal interface TokenGenerator
{
// Token: 0x06001A9B RID: 6811
int GetToken(string str);
// Token: 0x06001A9C RID: 6812
int GetToken(MemberInfo member);
// Token: 0x06001A9D RID: 6813
int GetToken(MethodInfo method, Type[] opt_param_types);
// Token: 0x06001A9E RID: 6814
int GetToken(SignatureHelper helper);
}
}
@@ -0,0 +1,2754 @@
using System;
using System.Collections;
using System.Diagnostics.SymbolStore;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
namespace System.Reflection.Emit
{
/// <summary>Defines and creates new instances of classes during run time.</summary>
// Token: 0x0200021B RID: 539
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
[ComDefaultInterface(typeof(_TypeBuilder))]
public sealed class TypeBuilder : Type, _TypeBuilder
{
// Token: 0x06001C58 RID: 7256 RVA: 0x0006AA90 File Offset: 0x00068C90
internal TypeBuilder(ModuleBuilder mb, TypeAttributes attr, int table_idx)
{
this.parent = null;
this.attrs = attr;
this.class_size = 0;
this.table_idx = table_idx;
this.fullname = (this.tname = ((table_idx != 1) ? ("type_" + table_idx) : "<Module>"));
this.nspace = string.Empty;
this.pmodule = mb;
this.setup_internal_class(this);
}
// Token: 0x06001C59 RID: 7257 RVA: 0x0006AB08 File Offset: 0x00068D08
internal TypeBuilder(ModuleBuilder mb, string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packing_size, int type_size, Type nesting_type)
{
this.parent = parent;
this.attrs = attr;
this.class_size = type_size;
this.packing_size = packing_size;
this.nesting_type = nesting_type;
this.check_name("fullname", name);
if (parent == null && (attr & TypeAttributes.ClassSemanticsMask) != TypeAttributes.NotPublic && (attr & TypeAttributes.Abstract) == TypeAttributes.NotPublic)
{
throw new InvalidOperationException("Interface must be declared abstract.");
}
int num = name.LastIndexOf('.');
if (num != -1)
{
this.tname = name.Substring(num + 1);
this.nspace = name.Substring(0, num);
}
else
{
this.tname = name;
this.nspace = string.Empty;
}
if (interfaces != null)
{
this.interfaces = new Type[interfaces.Length];
Array.Copy(interfaces, this.interfaces, interfaces.Length);
}
this.pmodule = mb;
if ((attr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.NotPublic && parent == null && !this.IsCompilerContext)
{
this.parent = typeof(object);
}
this.table_idx = mb.get_next_table_index(this, 2, true);
this.setup_internal_class(this);
this.fullname = this.GetFullName();
}
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
/// <param name="cNames">Count of the names to be mapped.</param>
/// <param name="lcid">The locale context in which to interpret the names.</param>
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C5A RID: 7258 RVA: 0x0006AC34 File Offset: 0x00068E34
void _TypeBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
/// <param name="iTInfo">The type information to return.</param>
/// <param name="lcid">The locale identifier for the type information.</param>
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C5B RID: 7259 RVA: 0x0006AC3C File Offset: 0x00068E3C
void _TypeBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C5C RID: 7260 RVA: 0x0006AC44 File Offset: 0x00068E44
void _TypeBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// <summary>Provides access to properties and methods exposed by an object.</summary>
/// <param name="dispIdMember">Identifies the member.</param>
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
/// <param name="lcid">The locale context in which to interpret arguments.</param>
/// <param name="wFlags">Flags describing the context of the call.</param>
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
/// <param name="puArgErr">The index of the first argument that has an error.</param>
/// <exception cref="T:System.NotImplementedException">Late-bound access using the COM IDispatch interface is not supported.</exception>
// Token: 0x06001C5D RID: 7261 RVA: 0x0006AC4C File Offset: 0x00068E4C
void _TypeBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
{
throw new NotImplementedException();
}
// Token: 0x06001C5E RID: 7262 RVA: 0x0006AC54 File Offset: 0x00068E54
protected override TypeAttributes GetAttributeFlagsImpl()
{
return this.attrs;
}
// Token: 0x06001C5F RID: 7263
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void setup_internal_class(TypeBuilder tb);
// Token: 0x06001C60 RID: 7264
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void create_internal_class(TypeBuilder tb);
// Token: 0x06001C61 RID: 7265
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void setup_generic_class();
// Token: 0x06001C62 RID: 7266
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void create_generic_class();
// Token: 0x06001C63 RID: 7267
[MethodImpl(MethodImplOptions.InternalCall)]
private extern EventInfo get_event_info(EventBuilder eb);
/// <summary>Retrieves the dynamic assembly that contains this type definition.</summary>
/// <returns>Read-only. Retrieves the dynamic assembly that contains this type definition.</returns>
// Token: 0x17000515 RID: 1301
// (get) Token: 0x06001C64 RID: 7268 RVA: 0x0006AC5C File Offset: 0x00068E5C
public override Assembly Assembly
{
get
{
return this.pmodule.Assembly;
}
}
/// <summary>Returns the full name of this type qualified by the display name of the assembly.</summary>
/// <returns>Read-only. The full name of this type qualified by the display name of the assembly.</returns>
// Token: 0x17000516 RID: 1302
// (get) Token: 0x06001C65 RID: 7269 RVA: 0x0006AC6C File Offset: 0x00068E6C
public override string AssemblyQualifiedName
{
get
{
return this.fullname + ", " + this.Assembly.FullName;
}
}
/// <summary>Retrieves the base type of this type.</summary>
/// <returns>Read-only. Retrieves the base type of this type.</returns>
// Token: 0x17000517 RID: 1303
// (get) Token: 0x06001C66 RID: 7270 RVA: 0x0006AC8C File Offset: 0x00068E8C
public override Type BaseType
{
get
{
return this.parent;
}
}
/// <summary>Returns the type that declared this type.</summary>
/// <returns>Read-only. The type that declared this type.</returns>
// Token: 0x17000518 RID: 1304
// (get) Token: 0x06001C67 RID: 7271 RVA: 0x0006AC94 File Offset: 0x00068E94
public override Type DeclaringType
{
get
{
return this.nesting_type;
}
}
/// <summary>Returns the underlying system type for this TypeBuilder.</summary>
/// <returns>Read-only. Returns the underlying system type.</returns>
/// <exception cref="T:System.InvalidOperationException">This type is an enumeration, but there is no underlying system type. </exception>
// Token: 0x17000519 RID: 1305
// (get) Token: 0x06001C68 RID: 7272 RVA: 0x0006AC9C File Offset: 0x00068E9C
public override Type UnderlyingSystemType
{
get
{
if (this.is_created)
{
return this.created.UnderlyingSystemType;
}
if (!this.IsEnum || this.IsCompilerContext)
{
return this;
}
if (this.underlying_type != null)
{
return this.underlying_type;
}
throw new InvalidOperationException("Enumeration type is not defined.");
}
}
// Token: 0x06001C69 RID: 7273 RVA: 0x0006ACF4 File Offset: 0x00068EF4
private string GetFullName()
{
if (this.nesting_type != null)
{
return this.nesting_type.FullName + "+" + this.tname;
}
if (this.nspace != null && this.nspace.Length > 0)
{
return this.nspace + "." + this.tname;
}
return this.tname;
}
/// <summary>Retrieves the full path of this type.</summary>
/// <returns>Read-only. Retrieves the full path of this type.</returns>
// Token: 0x1700051A RID: 1306
// (get) Token: 0x06001C6A RID: 7274 RVA: 0x0006AD64 File Offset: 0x00068F64
public override string FullName
{
get
{
return this.fullname;
}
}
/// <summary>Retrieves the GUID of this type.</summary>
/// <returns>Read-only. Retrieves the GUID of this type </returns>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported for incomplete types. </exception>
// Token: 0x1700051B RID: 1307
// (get) Token: 0x06001C6B RID: 7275 RVA: 0x0006AD6C File Offset: 0x00068F6C
public override Guid GUID
{
get
{
this.check_created();
return this.created.GUID;
}
}
/// <summary>Retrieves the dynamic module that contains this type definition.</summary>
/// <returns>Read-only. Retrieves the dynamic module that contains this type definition.</returns>
// Token: 0x1700051C RID: 1308
// (get) Token: 0x06001C6C RID: 7276 RVA: 0x0006AD80 File Offset: 0x00068F80
public override Module Module
{
get
{
return this.pmodule;
}
}
/// <summary>Retrieves the name of this type.</summary>
/// <returns>Read-only. Retrieves the <see cref="T:System.String" /> name of this type.</returns>
// Token: 0x1700051D RID: 1309
// (get) Token: 0x06001C6D RID: 7277 RVA: 0x0006AD88 File Offset: 0x00068F88
public override string Name
{
get
{
return this.tname;
}
}
/// <summary>Retrieves the namespace where this TypeBuilder is defined.</summary>
/// <returns>Read-only. Retrieves the namespace where this TypeBuilder is defined.</returns>
// Token: 0x1700051E RID: 1310
// (get) Token: 0x06001C6E RID: 7278 RVA: 0x0006AD90 File Offset: 0x00068F90
public override string Namespace
{
get
{
return this.nspace;
}
}
/// <summary>Retrieves the packing size of this type.</summary>
/// <returns>Read-only. Retrieves the packing size of this type.</returns>
// Token: 0x1700051F RID: 1311
// (get) Token: 0x06001C6F RID: 7279 RVA: 0x0006AD98 File Offset: 0x00068F98
public PackingSize PackingSize
{
get
{
return this.packing_size;
}
}
/// <summary>Retrieves the total size of a type.</summary>
/// <returns>Read-only. Retrieves this types total size.</returns>
// Token: 0x17000520 RID: 1312
// (get) Token: 0x06001C70 RID: 7280 RVA: 0x0006ADA0 File Offset: 0x00068FA0
public int Size
{
get
{
return this.class_size;
}
}
/// <summary>Returns the type that was used to obtain this type.</summary>
/// <returns>Read-only. The type that was used to obtain this type.</returns>
// Token: 0x17000521 RID: 1313
// (get) Token: 0x06001C71 RID: 7281 RVA: 0x0006ADA8 File Offset: 0x00068FA8
public override Type ReflectedType
{
get
{
return this.nesting_type;
}
}
/// <summary>Adds declarative security to this type.</summary>
/// <param name="action">The security action to be taken such as Demand, Assert, and so on. </param>
/// <param name="pset">The set of permissions the action applies to. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="action" /> is invalid (RequestMinimum, RequestOptional, and RequestRefuse are invalid). </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- The permission set <paramref name="pset" /> contains an action that was added earlier by AddDeclarativeSecurity. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="pset" /> is null. </exception>
// Token: 0x06001C72 RID: 7282 RVA: 0x0006ADB0 File Offset: 0x00068FB0
public void AddDeclarativeSecurity(SecurityAction action, PermissionSet pset)
{
}
/// <summary>Adds an interface that this type implements.</summary>
/// <param name="interfaceType">The interface that this type implements. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="interfaceType" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C73 RID: 7283 RVA: 0x0006ADB4 File Offset: 0x00068FB4
[ComVisible(true)]
public void AddInterfaceImplementation(Type interfaceType)
{
if (interfaceType == null)
{
throw new ArgumentNullException("interfaceType");
}
this.check_not_created();
if (this.interfaces != null)
{
foreach (Type type in this.interfaces)
{
if (type == interfaceType)
{
return;
}
}
Type[] array2 = new Type[this.interfaces.Length + 1];
this.interfaces.CopyTo(array2, 0);
array2[this.interfaces.Length] = interfaceType;
this.interfaces = array2;
}
else
{
this.interfaces = new Type[1];
this.interfaces[0] = interfaceType;
}
}
// Token: 0x06001C74 RID: 7284 RVA: 0x0006AE54 File Offset: 0x00069054
protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
this.check_created();
if (this.created != typeof(object))
{
return this.created.GetConstructor(bindingAttr, binder, callConvention, types, modifiers);
}
if (this.ctors == null)
{
return null;
}
ConstructorBuilder constructorBuilder = null;
int num = 0;
foreach (ConstructorBuilder constructorBuilder2 in this.ctors)
{
if (callConvention == CallingConventions.Any || constructorBuilder2.CallingConvention == callConvention)
{
constructorBuilder = constructorBuilder2;
num++;
}
}
if (num == 0)
{
return null;
}
if (types != null)
{
MethodBase[] array2 = new MethodBase[num];
if (num == 1)
{
array2[0] = constructorBuilder;
}
else
{
num = 0;
foreach (ConstructorBuilder constructorInfo in this.ctors)
{
if (callConvention == CallingConventions.Any || constructorInfo.CallingConvention == callConvention)
{
array2[num++] = constructorInfo;
}
}
}
if (binder == null)
{
binder = Binder.DefaultBinder;
}
return (ConstructorInfo)binder.SelectMethod(bindingAttr, array2, types, modifiers);
}
if (num > 1)
{
throw new AmbiguousMatchException();
}
return constructorBuilder;
}
/// <summary>Determines whether a custom attribute is applied to the current type.</summary>
/// <returns>true if one or more instances of <paramref name="attributeType" />, or an attribute derived from <paramref name="attributeType" />, is defined on this type; otherwise, false.</returns>
/// <param name="attributeType">The type of attribute to search for. Only attributes that are assignable to this type are returned. </param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported for incomplete types. Retrieve the type using <see cref="M:System.Type.GetType" /> and call <see cref="M:System.Reflection.MemberInfo.IsDefined(System.Type,System.Boolean)" /> on the returned <see cref="T:System.Type" />. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="attributeType" /> is not defined.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="attributeType" /> is null.</exception>
// Token: 0x06001C75 RID: 7285 RVA: 0x0006AF88 File Offset: 0x00069188
public override bool IsDefined(Type attributeType, bool inherit)
{
if (!this.is_created && !this.IsCompilerContext)
{
throw new NotSupportedException();
}
return MonoCustomAttrs.IsDefined(this, attributeType, inherit);
}
/// <summary>Returns all the custom attributes defined for this type.</summary>
/// <returns>Returns an array of objects representing all the custom attributes of this type.</returns>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported for incomplete types. Retrieve the type using <see cref="M:System.Type.GetType" /> and call <see cref="M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean)" /> on the returned <see cref="T:System.Type" />. </exception>
// Token: 0x06001C76 RID: 7286 RVA: 0x0006AFBC File Offset: 0x000691BC
public override object[] GetCustomAttributes(bool inherit)
{
this.check_created();
return this.created.GetCustomAttributes(inherit);
}
/// <summary>Returns all the custom attributes of the current type that are assignable to a specified type.</summary>
/// <returns>An array of custom attributes defined on the current type.</returns>
/// <param name="attributeType">The type of attribute to search for. Only attributes that are assignable to this type are returned.</param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported for incomplete types. Retrieve the type using <see cref="M:System.Type.GetType" /> and call <see cref="M:System.Reflection.MemberInfo.GetCustomAttributes(System.Boolean)" /> on the returned <see cref="T:System.Type" />. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="attributeType" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">The type must be a type provided by the underlying runtime system.</exception>
// Token: 0x06001C77 RID: 7287 RVA: 0x0006AFD0 File Offset: 0x000691D0
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
this.check_created();
return this.created.GetCustomAttributes(attributeType, inherit);
}
/// <summary>Defines a nested type, given its name.</summary>
/// <returns>The defined nested type.</returns>
/// <param name="name">The short name of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001C78 RID: 7288 RVA: 0x0006AFE8 File Offset: 0x000691E8
public TypeBuilder DefineNestedType(string name)
{
return this.DefineNestedType(name, TypeAttributes.NestedPrivate, this.pmodule.assemblyb.corlib_object_type, null);
}
/// <summary>Defines a nested type, given its name and attributes.</summary>
/// <returns>The defined nested type.</returns>
/// <param name="name">The short name of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the type. </param>
/// <exception cref="T:System.ArgumentException">The nested attribute is not specified.-or- This type is sealed.-or- This type is an array.-or- This type is an interface, but the nested type is not an interface.-or- The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001C79 RID: 7289 RVA: 0x0006B004 File Offset: 0x00069204
public TypeBuilder DefineNestedType(string name, TypeAttributes attr)
{
return this.DefineNestedType(name, attr, this.pmodule.assemblyb.corlib_object_type, null);
}
/// <summary>Defines a nested type, given its name, attributes, and the type that it extends.</summary>
/// <returns>The defined nested type.</returns>
/// <param name="name">The short name of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the type. </param>
/// <param name="parent">The type that the nested type extends. </param>
/// <exception cref="T:System.ArgumentException">The nested attribute is not specified.-or- This type is sealed.-or- This type is an array.-or- This type is an interface, but the nested type is not an interface.-or- The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001C7A RID: 7290 RVA: 0x0006B020 File Offset: 0x00069220
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent)
{
return this.DefineNestedType(name, attr, parent, null);
}
// Token: 0x06001C7B RID: 7291 RVA: 0x0006B02C File Offset: 0x0006922C
private TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packSize, int typeSize)
{
if (interfaces != null)
{
for (int i = 0; i < interfaces.Length; i++)
{
if (interfaces[i] == null)
{
throw new ArgumentNullException("interfaces");
}
}
}
TypeBuilder typeBuilder = new TypeBuilder(this.pmodule, name, attr, parent, interfaces, packSize, typeSize, this);
typeBuilder.fullname = typeBuilder.GetFullName();
this.pmodule.RegisterTypeName(typeBuilder, typeBuilder.fullname);
if (this.subtypes != null)
{
TypeBuilder[] array = new TypeBuilder[this.subtypes.Length + 1];
Array.Copy(this.subtypes, array, this.subtypes.Length);
array[this.subtypes.Length] = typeBuilder;
this.subtypes = array;
}
else
{
this.subtypes = new TypeBuilder[1];
this.subtypes[0] = typeBuilder;
}
return typeBuilder;
}
/// <summary>Defines a nested type, given its name, attributes, the type that it extends, and the interfaces that it implements.</summary>
/// <returns>The defined nested type.</returns>
/// <param name="name">The short name of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the type. </param>
/// <param name="parent">The type that the nested type extends. </param>
/// <param name="interfaces">The interfaces that the nested type implements. </param>
/// <exception cref="T:System.ArgumentException">The nested attribute is not specified.-or- This type is sealed.-or- This type is an array.-or- This type is an interface, but the nested type is not an interface.-or- The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null.-or-An element of the <paramref name="interfaces" /> array is null.</exception>
// Token: 0x06001C7C RID: 7292 RVA: 0x0006B100 File Offset: 0x00069300
[ComVisible(true)]
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, Type[] interfaces)
{
return this.DefineNestedType(name, attr, parent, interfaces, PackingSize.Unspecified, 0);
}
/// <summary>Defines a nested type, given its name, attributes, the total size of the type, and the type that it extends.</summary>
/// <returns>The defined nested type.</returns>
/// <param name="name">The short name of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the type. </param>
/// <param name="parent">The type that the nested type extends. </param>
/// <param name="typeSize">The total size of the type. </param>
/// <exception cref="T:System.ArgumentException">The nested attribute is not specified.-or- This type is sealed.-or- This type is an array.-or- This type is an interface, but the nested type is not an interface.-or- The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001C7D RID: 7293 RVA: 0x0006B110 File Offset: 0x00069310
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, int typeSize)
{
return this.DefineNestedType(name, attr, parent, null, PackingSize.Unspecified, typeSize);
}
/// <summary>Defines a nested type, given its name, attributes, the type that it extends, and the packing size.</summary>
/// <returns>The defined nested type.</returns>
/// <param name="name">The short name of the type. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attr">The attributes of the type. </param>
/// <param name="parent">The type that the nested type extends. </param>
/// <param name="packSize">The packing size of the type. </param>
/// <exception cref="T:System.ArgumentException">The nested attribute is not specified.-or- This type is sealed.-or- This type is an array.-or- This type is an interface, but the nested type is not an interface.-or- The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
// Token: 0x06001C7E RID: 7294 RVA: 0x0006B120 File Offset: 0x00069320
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, PackingSize packSize)
{
return this.DefineNestedType(name, attr, parent, null, packSize, 0);
}
/// <summary>Adds a new constructor to the type, with the given attributes and signature.</summary>
/// <returns>The defined constructor.</returns>
/// <param name="attributes">The attributes of the constructor. </param>
/// <param name="callingConvention">The calling convention of the constructor. </param>
/// <param name="parameterTypes">The parameter types of the constructor. </param>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C7F RID: 7295 RVA: 0x0006B130 File Offset: 0x00069330
[ComVisible(true)]
public ConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes)
{
return this.DefineConstructor(attributes, callingConvention, parameterTypes, null, null);
}
/// <summary>Adds a new constructor to the type, with the given attributes, signature, and custom modifiers.</summary>
/// <returns>The defined constructor.</returns>
/// <param name="attributes">The attributes of the constructor. </param>
/// <param name="callingConvention">The calling convention of the constructor. </param>
/// <param name="parameterTypes">The parameter types of the constructor. </param>
/// <param name="requiredCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no required custom modifiers, specify null instead of an array of types. If none of the parameters have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="optionalCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no optional custom modifiers, specify null instead of an array of types. If none of the parameters have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.ArgumentException">The size of <paramref name="requiredCustomModifiers" /> or <paramref name="optionalCustomModifiers" /> does not equal the size of <paramref name="parameterTypes" />.</exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false.</exception>
// Token: 0x06001C80 RID: 7296 RVA: 0x0006B140 File Offset: 0x00069340
[ComVisible(true)]
public ConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers)
{
this.check_not_created();
ConstructorBuilder constructorBuilder = new ConstructorBuilder(this, attributes, callingConvention, parameterTypes, requiredCustomModifiers, optionalCustomModifiers);
if (this.ctors != null)
{
ConstructorBuilder[] array = new ConstructorBuilder[this.ctors.Length + 1];
Array.Copy(this.ctors, array, this.ctors.Length);
array[this.ctors.Length] = constructorBuilder;
this.ctors = array;
}
else
{
this.ctors = new ConstructorBuilder[1];
this.ctors[0] = constructorBuilder;
}
return constructorBuilder;
}
/// <summary>Defines the default constructor. The constructor defined here will simply call the default constructor of the parent.</summary>
/// <returns>Returns the constructor.</returns>
/// <param name="attributes">A MethodAttributes object representing the attributes to be applied to the constructor. </param>
/// <exception cref="T:System.NotSupportedException">The parent type (base type) does not have a default constructor. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false.</exception>
// Token: 0x06001C81 RID: 7297 RVA: 0x0006B1C0 File Offset: 0x000693C0
[ComVisible(true)]
public ConstructorBuilder DefineDefaultConstructor(MethodAttributes attributes)
{
Type corlib_object_type;
if (this.parent != null)
{
corlib_object_type = this.parent;
}
else
{
corlib_object_type = this.pmodule.assemblyb.corlib_object_type;
}
ConstructorInfo constructor = corlib_object_type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
if (constructor == null)
{
throw new NotSupportedException("Parent does not have a default constructor. The default constructor must be explicitly defined.");
}
ConstructorBuilder constructorBuilder = this.DefineConstructor(attributes, CallingConventions.Standard, Type.EmptyTypes);
ILGenerator ilgenerator = constructorBuilder.GetILGenerator();
ilgenerator.Emit(OpCodes.Ldarg_0);
ilgenerator.Emit(OpCodes.Call, constructor);
ilgenerator.Emit(OpCodes.Ret);
return constructorBuilder;
}
// Token: 0x06001C82 RID: 7298 RVA: 0x0006B250 File Offset: 0x00069450
private void append_method(MethodBuilder mb)
{
if (this.methods != null)
{
if (this.methods.Length == this.num_methods)
{
MethodBuilder[] array = new MethodBuilder[this.methods.Length * 2];
Array.Copy(this.methods, array, this.num_methods);
this.methods = array;
}
}
else
{
this.methods = new MethodBuilder[1];
}
this.methods[this.num_methods] = mb;
this.num_methods++;
}
/// <summary>Adds a new method to the type, with the specified name, method attributes, and method signature.</summary>
/// <returns>The defined method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="parameterTypes">The types of the parameters of the method. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- The type of the parent of this method is an interface, and this method is not virtual (Overridable in Visual Basic). </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false. </exception>
// Token: 0x06001C83 RID: 7299 RVA: 0x0006B2D4 File Offset: 0x000694D4
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)
{
return this.DefineMethod(name, attributes, CallingConventions.Standard, returnType, parameterTypes);
}
/// <summary>Adds a new method to the type, with the specified name, method attributes, calling convention, and method signature.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.MethodBuilder" /> representing the newly defined method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The calling convention of the method. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="parameterTypes">The types of the parameters of the method. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- The type of the parent of this method is an interface, and this method is not virtual (Overridable in Visual Basic). </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false. </exception>
// Token: 0x06001C84 RID: 7300 RVA: 0x0006B2E4 File Offset: 0x000694E4
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
{
return this.DefineMethod(name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null);
}
/// <summary>Adds a new method to the type, with the specified name, method attributes, calling convention, method signature, and custom modifiers.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.MethodBuilder" /> object representing the newly added method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The calling convention of the method. </param>
/// <param name="returnType">The return type of the method. </param>
/// <param name="returnTypeRequiredCustomModifiers">An array of types representing the required custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the method. If the return type has no required custom modifiers, specify null.</param>
/// <param name="returnTypeOptionalCustomModifiers">An array of types representing the optional custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the method. If the return type has no optional custom modifiers, specify null.</param>
/// <param name="parameterTypes">The types of the parameters of the method.</param>
/// <param name="parameterTypeRequiredCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no required custom modifiers, specify null instead of an array of types. If none of the parameters have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="parameterTypeOptionalCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no optional custom modifiers, specify null instead of an array of types. If none of the parameters have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- The type of the parent of this method is an interface, and this method is not virtual (Overridable in Visual Basic). -or-The size of <paramref name="parameterTypeRequiredCustomModifiers" /> or <paramref name="parameterTypeOptionalCustomModifiers" /> does not equal the size of <paramref name="parameterTypes" />.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false.</exception>
// Token: 0x06001C85 RID: 7301 RVA: 0x0006B304 File Offset: 0x00069504
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
{
this.check_name("name", name);
this.check_not_created();
if (this.IsInterface && ((attributes & MethodAttributes.Abstract) == MethodAttributes.PrivateScope || (attributes & MethodAttributes.Virtual) == MethodAttributes.PrivateScope) && (attributes & MethodAttributes.Static) == MethodAttributes.PrivateScope)
{
throw new ArgumentException("Interface method must be abstract and virtual.");
}
if (returnType == null)
{
returnType = this.pmodule.assemblyb.corlib_void_type;
}
MethodBuilder methodBuilder = new MethodBuilder(this, name, attributes, callingConvention, returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers);
this.append_method(methodBuilder);
return methodBuilder;
}
/// <summary>Defines a PInvoke method given its name, the name of the DLL in which the method is defined, the name of the entry point, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, and the PInvoke flags.</summary>
/// <returns>The defined PInvoke method.</returns>
/// <param name="name">The name of the PInvoke method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="dllName">The name of the DLL in which the PInvoke method is defined. </param>
/// <param name="entryName">The name of the entry point in the DLL. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The method's calling convention. </param>
/// <param name="returnType">The method's return type. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <param name="nativeCallConv">The native calling convention. </param>
/// <param name="nativeCharSet">The method's native character set. </param>
/// <exception cref="T:System.ArgumentException">The method is not static.-or- The parent type is an interface.-or- The method is abstract.-or- The method was previously defined.-or- The length of <paramref name="name" />, <paramref name="dllName" />, or <paramref name="entryName" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" />, <paramref name="dllName" />, or <paramref name="entryName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C86 RID: 7302 RVA: 0x0006B390 File Offset: 0x00069590
public MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet)
{
return this.DefinePInvokeMethod(name, dllName, entryName, attributes, callingConvention, returnType, null, null, parameterTypes, null, null, nativeCallConv, nativeCharSet);
}
/// <summary>Defines a PInvoke method given its name, the name of the DLL in which the method is defined, the name of the entry point, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, the PInvoke flags, and custom modifiers for the parameters and return type.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.MethodBuilder" /> representing the defined PInvoke method.</returns>
/// <param name="name">The name of the PInvoke method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="dllName">The name of the DLL in which the PInvoke method is defined. </param>
/// <param name="entryName">The name of the entry point in the DLL. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The method's calling convention. </param>
/// <param name="returnType">The method's return type. </param>
/// <param name="returnTypeRequiredCustomModifiers">An array of types representing the required custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the method. If the return type has no required custom modifiers, specify null.</param>
/// <param name="returnTypeOptionalCustomModifiers">An array of types representing the optional custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the method. If the return type has no optional custom modifiers, specify null.</param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <param name="parameterTypeRequiredCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no required custom modifiers, specify null instead of an array of types. If none of the parameters have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="parameterTypeOptionalCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no optional custom modifiers, specify null instead of an array of types. If none of the parameters have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="nativeCallConv">The native calling convention. </param>
/// <param name="nativeCharSet">The method's native character set. </param>
/// <exception cref="T:System.ArgumentException">The method is not static.-or- The parent type is an interface.-or- The method is abstract.-or- The method was previously defined.-or- The length of <paramref name="name" />, <paramref name="dllName" />, or <paramref name="entryName" /> is zero. -or-The size of <paramref name="parameterTypeRequiredCustomModifiers" /> or <paramref name="parameterTypeOptionalCustomModifiers" /> does not equal the size of <paramref name="parameterTypes" />.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" />, <paramref name="dllName" />, or <paramref name="entryName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false.</exception>
// Token: 0x06001C87 RID: 7303 RVA: 0x0006B3B8 File Offset: 0x000695B8
public MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers, CallingConvention nativeCallConv, CharSet nativeCharSet)
{
this.check_name("name", name);
this.check_name("dllName", dllName);
this.check_name("entryName", entryName);
if ((attributes & MethodAttributes.Abstract) != MethodAttributes.PrivateScope)
{
throw new ArgumentException("PInvoke methods must be static and native and cannot be abstract.");
}
if (this.IsInterface)
{
throw new ArgumentException("PInvoke methods cannot exist on interfaces.");
}
this.check_not_created();
MethodBuilder methodBuilder = new MethodBuilder(this, name, attributes, callingConvention, returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers, dllName, entryName, nativeCallConv, nativeCharSet);
this.append_method(methodBuilder);
return methodBuilder;
}
/// <summary>Defines a PInvoke method given its name, the name of the DLL in which the method is defined, the attributes of the method, the calling convention of the method, the return type of the method, the types of the parameters of the method, and the PInvoke flags.</summary>
/// <returns>The defined PInvoke method.</returns>
/// <param name="name">The name of the PInvoke method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="dllName">The name of the DLL in which the PInvoke method is defined. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The method's calling convention. </param>
/// <param name="returnType">The method's return type. </param>
/// <param name="parameterTypes">The types of the method's parameters. </param>
/// <param name="nativeCallConv">The native calling convention. </param>
/// <param name="nativeCharSet">The method's native character set. </param>
/// <exception cref="T:System.ArgumentException">The method is not static.-or- The parent type is an interface.-or- The method is abstract.-or- The method was previously defined.-or- The length of <paramref name="name" /> or <paramref name="dllName" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="dllName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The containing type has been previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C88 RID: 7304 RVA: 0x0006B444 File Offset: 0x00069644
public MethodBuilder DefinePInvokeMethod(string name, string dllName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet)
{
return this.DefinePInvokeMethod(name, dllName, name, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet);
}
/// <summary>Adds a new method to the type, with the specified name and method attributes.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.MethodBuilder" /> representing the newly defined method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- The type of the parent of this method is an interface, and this method is not virtual (Overridable in Visual Basic). </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false. </exception>
// Token: 0x06001C89 RID: 7305 RVA: 0x0006B468 File Offset: 0x00069668
public MethodBuilder DefineMethod(string name, MethodAttributes attributes)
{
return this.DefineMethod(name, attributes, CallingConventions.Standard);
}
/// <summary>Adds a new method to the type, with the specified name, method attributes, and calling convention.</summary>
/// <returns>A <see cref="T:System.Reflection.Emit.MethodBuilder" /> representing the newly defined method.</returns>
/// <param name="name">The name of the method. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the method. </param>
/// <param name="callingConvention">The calling convention of the method. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero.-or- The type of the parent of this method is an interface and this method is not virtual (Overridable in Visual Basic). </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false. </exception>
// Token: 0x06001C8A RID: 7306 RVA: 0x0006B474 File Offset: 0x00069674
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, CallingConventions callingConvention)
{
return this.DefineMethod(name, attributes, callingConvention, null, null);
}
/// <summary>Specifies a given method body that implements a given method declaration, potentially with a different name.</summary>
/// <param name="methodInfoBody">The method body to be used. This should be a MethodBuilder object. </param>
/// <param name="methodInfoDeclaration">The method whose declaration is to be used. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="methodInfoBody" /> does not belong to this class. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="methodInfoBody" /> or <paramref name="methodInfoDeclaration" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or- The declaring type of <paramref name="methodInfoBody" /> is not the type represented by this <see cref="T:System.Reflection.Emit.TypeBuilder" />. </exception>
// Token: 0x06001C8B RID: 7307 RVA: 0x0006B484 File Offset: 0x00069684
public void DefineMethodOverride(MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration)
{
if (methodInfoBody == null)
{
throw new ArgumentNullException("methodInfoBody");
}
if (methodInfoDeclaration == null)
{
throw new ArgumentNullException("methodInfoDeclaration");
}
this.check_not_created();
if (methodInfoBody.DeclaringType != this)
{
throw new ArgumentException("method body must belong to this type");
}
if (methodInfoBody is MethodBuilder)
{
MethodBuilder methodBuilder = (MethodBuilder)methodInfoBody;
methodBuilder.set_override(methodInfoDeclaration);
}
}
/// <summary>Adds a new field to the type, with the given name, attributes, and field type.</summary>
/// <returns>The defined field.</returns>
/// <param name="fieldName">The name of the field. <paramref name="fieldName" /> cannot contain embedded nulls. </param>
/// <param name="type">The type of the field </param>
/// <param name="attributes">The attributes of the field. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="fieldName" /> is zero.-or- <paramref name="type" /> is System.Void.-or- A total size was specified for the parent class of this field. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="fieldName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.</exception>
// Token: 0x06001C8C RID: 7308 RVA: 0x0006B4EC File Offset: 0x000696EC
public FieldBuilder DefineField(string fieldName, Type type, FieldAttributes attributes)
{
return this.DefineField(fieldName, type, null, null, attributes);
}
/// <summary>Adds a new field to the type, with the given name, attributes, field type, and custom modifiers.</summary>
/// <returns>The defined field.</returns>
/// <param name="fieldName">The name of the field. <paramref name="fieldName" /> cannot contain embedded nulls. </param>
/// <param name="type">The type of the field </param>
/// <param name="requiredCustomModifiers">An array of types representing the required custom modifiers for the field, such as <see cref="T:Microsoft.VisualC.IsConstModifier" />.</param>
/// <param name="optionalCustomModifiers">An array of types representing the optional custom modifiers for the field, such as <see cref="T:Microsoft.VisualC.IsConstModifier" />.</param>
/// <param name="attributes">The attributes of the field. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="fieldName" /> is zero.-or- <paramref name="type" /> is System.Void.-or- A total size was specified for the parent class of this field. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="fieldName" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C8D RID: 7309 RVA: 0x0006B4FC File Offset: 0x000696FC
public FieldBuilder DefineField(string fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes)
{
this.check_name("fieldName", fieldName);
if (type == typeof(void))
{
throw new ArgumentException("Bad field type in defining field.");
}
this.check_not_created();
FieldBuilder fieldBuilder = new FieldBuilder(this, fieldName, type, attributes, requiredCustomModifiers, optionalCustomModifiers);
if (this.fields != null)
{
if (this.fields.Length == this.num_fields)
{
FieldBuilder[] array = new FieldBuilder[this.fields.Length * 2];
Array.Copy(this.fields, array, this.num_fields);
this.fields = array;
}
this.fields[this.num_fields] = fieldBuilder;
this.num_fields++;
}
else
{
this.fields = new FieldBuilder[1];
this.fields[0] = fieldBuilder;
this.num_fields++;
this.create_internal_class(this);
}
if (this.IsEnum && !this.IsCompilerContext && this.underlying_type == null && (attributes & FieldAttributes.Static) == FieldAttributes.PrivateScope)
{
this.underlying_type = type;
}
return fieldBuilder;
}
/// <summary>Adds a new property to the type, with the given name and property signature.</summary>
/// <returns>The defined property.</returns>
/// <param name="name">The name of the property. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the property. </param>
/// <param name="returnType">The return type of the property. </param>
/// <param name="parameterTypes">The types of the parameters of the property. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. -or- Any of the elements of the <paramref name="parameterTypes" /> array is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C8E RID: 7310 RVA: 0x0006B60C File Offset: 0x0006980C
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes)
{
return this.DefineProperty(name, attributes, returnType, null, null, parameterTypes, null, null);
}
/// <summary>Adds a new property to the type, with the given name, property signature, and custom modifiers.</summary>
/// <returns>The defined property.</returns>
/// <param name="name">The name of the property. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the property. </param>
/// <param name="returnType">The return type of the property. </param>
/// <param name="returnTypeRequiredCustomModifiers">An array of types representing the required custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the property. If the return type has no required custom modifiers, specify null.</param>
/// <param name="returnTypeOptionalCustomModifiers">An array of types representing the optional custom modifiers, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />, for the return type of the property. If the return type has no optional custom modifiers, specify null.</param>
/// <param name="parameterTypes">The types of the parameters of the property. </param>
/// <param name="parameterTypeRequiredCustomModifiers">An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no required custom modifiers, specify null instead of an array of types. If none of the parameters have required custom modifiers, specify null instead of an array of arrays.</param>
/// <param name="parameterTypeOptionalCustomModifiers">An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter, such as <see cref="T:System.Runtime.CompilerServices.IsConst" />. If a particular parameter has no optional custom modifiers, specify null instead of an array of types. If none of the parameters have optional custom modifiers, specify null instead of an array of arrays.</param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null-or- Any of the elements of the <paramref name="parameterTypes" /> array is null</exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C8F RID: 7311 RVA: 0x0006B628 File Offset: 0x00069828
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
{
this.check_name("name", name);
if (parameterTypes != null)
{
for (int i = 0; i < parameterTypes.Length; i++)
{
if (parameterTypes[i] == null)
{
throw new ArgumentNullException("parameterTypes");
}
}
}
this.check_not_created();
PropertyBuilder propertyBuilder = new PropertyBuilder(this, name, attributes, returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers);
if (this.properties != null)
{
PropertyBuilder[] array = new PropertyBuilder[this.properties.Length + 1];
Array.Copy(this.properties, array, this.properties.Length);
array[this.properties.Length] = propertyBuilder;
this.properties = array;
}
else
{
this.properties = new PropertyBuilder[1];
this.properties[0] = propertyBuilder;
}
return propertyBuilder;
}
/// <summary>Defines the initializer for this type.</summary>
/// <returns>Returns a type initializer.</returns>
/// <exception cref="T:System.InvalidOperationException">The containing type has been previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001C90 RID: 7312 RVA: 0x0006B6F0 File Offset: 0x000698F0
[ComVisible(true)]
public ConstructorBuilder DefineTypeInitializer()
{
return this.DefineConstructor(MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, CallingConventions.Standard, null);
}
// Token: 0x06001C91 RID: 7313
[MethodImpl(MethodImplOptions.InternalCall)]
private extern Type create_runtime_class(TypeBuilder tb);
// Token: 0x06001C92 RID: 7314 RVA: 0x0006B700 File Offset: 0x00069900
private bool is_nested_in(Type t)
{
while (t != null)
{
if (t == this)
{
return true;
}
t = t.DeclaringType;
}
return false;
}
// Token: 0x06001C93 RID: 7315 RVA: 0x0006B720 File Offset: 0x00069920
private bool has_ctor_method()
{
MethodAttributes methodAttributes = MethodAttributes.SpecialName | MethodAttributes.RTSpecialName;
for (int i = 0; i < this.num_methods; i++)
{
MethodBuilder methodBuilder = this.methods[i];
if (methodBuilder.Name == ConstructorInfo.ConstructorName && (methodBuilder.Attributes & methodAttributes) == methodAttributes)
{
return true;
}
}
return false;
}
/// <summary>Creates a <see cref="T:System.Type" /> object for the class. After defining fields and methods on the class, CreateType is called in order to load its Type object.</summary>
/// <returns>Returns the new <see cref="T:System.Type" /> object for this class.</returns>
/// <exception cref="T:System.InvalidOperationException">The enclosing type has not been created.-or- This type is non-abstract and contains an abstract method.-or- This type is not an abstract class or an interface and has a method without a method body. </exception>
/// <exception cref="T:System.NotSupportedException">The type contains invalid Microsoft intermediate language (MSIL) code.-or- The branch target is specified using a 1-byte offset, but the target is at a distance greater than 127 bytes from the branch. </exception>
/// <exception cref="T:System.TypeLoadException">The type cannot be loaded. For example, it contains a static method that has the calling convention <see cref="F:System.Reflection.CallingConventions.HasThis" />.</exception>
// Token: 0x06001C94 RID: 7316 RVA: 0x0006B77C File Offset: 0x0006997C
public Type CreateType()
{
if (this.createTypeCalled)
{
return this.created;
}
if (!this.IsInterface && this.parent == null && this != this.pmodule.assemblyb.corlib_object_type && this.FullName != "<Module>")
{
this.SetParent(this.pmodule.assemblyb.corlib_object_type);
}
this.create_generic_class();
if (this.fields != null)
{
foreach (FieldBuilder fieldBuilder in this.fields)
{
if (fieldBuilder != null)
{
Type fieldType = fieldBuilder.FieldType;
if (!fieldBuilder.IsStatic && fieldType is TypeBuilder && fieldType.IsValueType && fieldType != this && this.is_nested_in(fieldType))
{
TypeBuilder typeBuilder = (TypeBuilder)fieldType;
if (!typeBuilder.is_created)
{
AppDomain.CurrentDomain.DoTypeResolve(typeBuilder);
if (!typeBuilder.is_created)
{
}
}
}
}
}
}
if (this.parent != null && this.parent.IsSealed)
{
throw new TypeLoadException(string.Concat(new object[] { "Could not load type '", this.FullName, "' from assembly '", this.Assembly, "' because the parent type is sealed." }));
}
if (this.parent == this.pmodule.assemblyb.corlib_enum_type && this.methods != null)
{
throw new TypeLoadException(string.Concat(new object[] { "Could not load type '", this.FullName, "' from assembly '", this.Assembly, "' because it is an enum with methods." }));
}
if (this.methods != null)
{
bool flag = !this.IsAbstract;
for (int j = 0; j < this.num_methods; j++)
{
MethodBuilder methodBuilder = this.methods[j];
if (flag && methodBuilder.IsAbstract)
{
throw new InvalidOperationException("Type is concrete but has abstract method " + methodBuilder);
}
methodBuilder.check_override();
methodBuilder.fixup();
}
}
if (!this.IsInterface && !this.IsValueType && this.ctors == null && this.tname != "<Module>" && ((this.GetAttributeFlagsImpl() & TypeAttributes.Abstract) | TypeAttributes.Sealed) != (TypeAttributes.Abstract | TypeAttributes.Sealed) && !this.has_ctor_method())
{
this.DefineDefaultConstructor(MethodAttributes.Public);
}
if (this.ctors != null)
{
foreach (ConstructorBuilder constructorBuilder in this.ctors)
{
constructorBuilder.fixup();
}
}
this.createTypeCalled = true;
this.created = this.create_runtime_class(this);
if (this.created != null)
{
return this.created;
}
return this;
}
// Token: 0x06001C95 RID: 7317 RVA: 0x0006BA84 File Offset: 0x00069C84
internal void GenerateDebugInfo(ISymbolWriter symbolWriter)
{
symbolWriter.OpenNamespace(this.Namespace);
if (this.methods != null)
{
for (int i = 0; i < this.num_methods; i++)
{
MethodBuilder methodBuilder = this.methods[i];
methodBuilder.GenerateDebugInfo(symbolWriter);
}
}
if (this.ctors != null)
{
foreach (ConstructorBuilder constructorBuilder in this.ctors)
{
constructorBuilder.GenerateDebugInfo(symbolWriter);
}
}
symbolWriter.CloseNamespace();
if (this.subtypes != null)
{
for (int k = 0; k < this.subtypes.Length; k++)
{
this.subtypes[k].GenerateDebugInfo(symbolWriter);
}
}
}
/// <summary>Returns an array of <see cref="T:System.Reflection.ConstructorInfo" /> objects representing the public and non-public constructors defined for this class, as specified.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.ConstructorInfo" /> objects representing the specified constructors defined for this class. If no constructors are defined, an empty array is returned.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> as in InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001C96 RID: 7318 RVA: 0x0006BB44 File Offset: 0x00069D44
[ComVisible(true)]
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr)
{
if (this.is_created)
{
return this.created.GetConstructors(bindingAttr);
}
if (!this.IsCompilerContext)
{
throw new NotSupportedException();
}
return this.GetConstructorsInternal(bindingAttr);
}
// Token: 0x06001C97 RID: 7319 RVA: 0x0006BB84 File Offset: 0x00069D84
internal ConstructorInfo[] GetConstructorsInternal(BindingFlags bindingAttr)
{
if (this.ctors == null)
{
return new ConstructorInfo[0];
}
ArrayList arrayList = new ArrayList();
foreach (ConstructorBuilder constructorBuilder in this.ctors)
{
bool flag = false;
MethodAttributes attributes = constructorBuilder.Attributes;
if ((attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
flag = false;
if ((attributes & MethodAttributes.Static) != MethodAttributes.PrivateScope)
{
if ((bindingAttr & BindingFlags.Static) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.Instance) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
arrayList.Add(constructorBuilder);
}
}
}
ConstructorInfo[] array2 = new ConstructorInfo[arrayList.Count];
arrayList.CopyTo(array2);
return array2;
}
/// <summary>Calling this method always throws <see cref="T:System.NotSupportedException" />.</summary>
/// <returns>This method is not supported. No value is returned.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not supported. </exception>
// Token: 0x06001C98 RID: 7320 RVA: 0x0006BC58 File Offset: 0x00069E58
public override Type GetElementType()
{
throw new NotSupportedException();
}
/// <summary>Returns the event with the specified name.</summary>
/// <returns>An <see cref="T:System.Reflection.EventInfo" /> object representing the event declared or inherited by this type with the specified name, or null if there are no matches.</returns>
/// <param name="name">The name of the event to search for. </param>
/// <param name="bindingAttr">A bitwise combination of <see cref="T:System.Reflection.BindingFlags" /> values that limits the search. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001C99 RID: 7321 RVA: 0x0006BC60 File Offset: 0x00069E60
public override EventInfo GetEvent(string name, BindingFlags bindingAttr)
{
this.check_created();
return this.created.GetEvent(name, bindingAttr);
}
/// <summary>Returns the public events declared or inherited by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.EventInfo" /> objects representing the public events declared or inherited by this type. An empty array is returned if there are no public events.</returns>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001C9A RID: 7322 RVA: 0x0006BC78 File Offset: 0x00069E78
public override EventInfo[] GetEvents()
{
return this.GetEvents(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
}
/// <summary>Returns the public and non-public events that are declared by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.EventInfo" /> objects representing the events declared or inherited by this type that match the specified binding flags. An empty array is returned if there are no matching events.</returns>
/// <param name="bindingAttr">A bitwise combination of <see cref="T:System.Reflection.BindingFlags" /> values that limits the search.</param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001C9B RID: 7323 RVA: 0x0006BC84 File Offset: 0x00069E84
public override EventInfo[] GetEvents(BindingFlags bindingAttr)
{
if (this.is_created)
{
return this.created.GetEvents(bindingAttr);
}
if (!this.IsCompilerContext)
{
throw new NotSupportedException();
}
return new EventInfo[0];
}
// Token: 0x06001C9C RID: 7324 RVA: 0x0006BCC0 File Offset: 0x00069EC0
internal EventInfo[] GetEvents_internal(BindingFlags bindingAttr)
{
if (this.events == null)
{
return new EventInfo[0];
}
ArrayList arrayList = new ArrayList();
foreach (EventBuilder eventBuilder in this.events)
{
if (eventBuilder != null)
{
EventInfo eventInfo = this.get_event_info(eventBuilder);
bool flag = false;
MethodInfo methodInfo = eventInfo.GetAddMethod(true);
if (methodInfo == null)
{
methodInfo = eventInfo.GetRemoveMethod(true);
}
if (methodInfo != null)
{
MethodAttributes attributes = methodInfo.Attributes;
if ((attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
flag = false;
if ((attributes & MethodAttributes.Static) != MethodAttributes.PrivateScope)
{
if ((bindingAttr & BindingFlags.Static) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.Instance) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
arrayList.Add(eventInfo);
}
}
}
}
}
EventInfo[] array2 = new EventInfo[arrayList.Count];
arrayList.CopyTo(array2);
return array2;
}
/// <summary>Returns the field specified by the given name.</summary>
/// <returns>Returns the <see cref="T:System.Reflection.FieldInfo" /> object representing the field declared or inherited by this type with the specified name and public or non-public modifier. If there are no matches then null is returned.</returns>
/// <param name="name">The name of the field to get. </param>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> as in InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001C9D RID: 7325 RVA: 0x0006BDD0 File Offset: 0x00069FD0
public override FieldInfo GetField(string name, BindingFlags bindingAttr)
{
if (this.created != null)
{
return this.created.GetField(name, bindingAttr);
}
if (this.fields == null)
{
return null;
}
foreach (FieldBuilder fieldInfo in this.fields)
{
if (fieldInfo != null)
{
if (!(fieldInfo.Name != name))
{
bool flag = false;
FieldAttributes attributes = fieldInfo.Attributes;
if ((attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Public)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
flag = false;
if ((attributes & FieldAttributes.Static) != FieldAttributes.PrivateScope)
{
if ((bindingAttr & BindingFlags.Static) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.Instance) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
return fieldInfo;
}
}
}
}
}
return null;
}
/// <summary>Returns the public and non-public fields that are declared by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.FieldInfo" /> objects representing the public and non-public fields declared or inherited by this type. An empty array is returned if there are no fields, as specified.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001C9E RID: 7326 RVA: 0x0006BEB4 File Offset: 0x0006A0B4
public override FieldInfo[] GetFields(BindingFlags bindingAttr)
{
if (this.created != null)
{
return this.created.GetFields(bindingAttr);
}
if (this.fields == null)
{
return new FieldInfo[0];
}
ArrayList arrayList = new ArrayList();
foreach (FieldBuilder fieldInfo in this.fields)
{
if (fieldInfo != null)
{
bool flag = false;
FieldAttributes attributes = fieldInfo.Attributes;
if ((attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Public)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
flag = false;
if ((attributes & FieldAttributes.Static) != FieldAttributes.PrivateScope)
{
if ((bindingAttr & BindingFlags.Static) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.Instance) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
arrayList.Add(fieldInfo);
}
}
}
}
FieldInfo[] array2 = new FieldInfo[arrayList.Count];
arrayList.CopyTo(array2);
return array2;
}
/// <summary>Returns the interface implemented (directly or indirectly) by this class with the fully qualified name matching the given interface name.</summary>
/// <returns>Returns a <see cref="T:System.Type" /> object representing the implemented interface. Returns null if no interface matching name is found.</returns>
/// <param name="name">The name of the interface. </param>
/// <param name="ignoreCase">If true, the search is case-insensitive. If false, the search is case-sensitive. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001C9F RID: 7327 RVA: 0x0006BFAC File Offset: 0x0006A1AC
public override Type GetInterface(string name, bool ignoreCase)
{
this.check_created();
return this.created.GetInterface(name, ignoreCase);
}
/// <summary>Returns an array of all the interfaces implemented on this type and its base types.</summary>
/// <returns>Returns an array of <see cref="T:System.Type" /> objects representing the implemented interfaces. If none are defined, an empty array is returned.</returns>
// Token: 0x06001CA0 RID: 7328 RVA: 0x0006BFC4 File Offset: 0x0006A1C4
public override Type[] GetInterfaces()
{
if (this.is_created)
{
return this.created.GetInterfaces();
}
if (this.interfaces != null)
{
Type[] array = new Type[this.interfaces.Length];
this.interfaces.CopyTo(array, 0);
return array;
}
return Type.EmptyTypes;
}
/// <summary>Returns all the public and non-public members declared or inherited by this type, as specified.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.MemberInfo" /> objects representing the public and non-public members defined on this type if <paramref name="nonPublic" /> is used; otherwise, only the public members are returned.</returns>
/// <param name="name">The name of the member. </param>
/// <param name="type">The type of the member to return. </param>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, as in InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001CA1 RID: 7329 RVA: 0x0006C018 File Offset: 0x0006A218
public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr)
{
this.check_created();
return this.created.GetMember(name, type, bindingAttr);
}
/// <summary>Returns the members for the public and non-public members declared or inherited by this type.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.MemberInfo" /> objects representing the public and non-public members declared or inherited by this type. An empty array is returned if there are no matching members.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, such as InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001CA2 RID: 7330 RVA: 0x0006C030 File Offset: 0x0006A230
public override MemberInfo[] GetMembers(BindingFlags bindingAttr)
{
this.check_created();
return this.created.GetMembers(bindingAttr);
}
// Token: 0x06001CA3 RID: 7331 RVA: 0x0006C044 File Offset: 0x0006A244
private MethodInfo[] GetMethodsByName(string name, BindingFlags bindingAttr, bool ignoreCase, Type reflected_type)
{
MethodInfo[] array2;
if ((bindingAttr & BindingFlags.DeclaredOnly) == BindingFlags.Default && this.parent != null)
{
MethodInfo[] array = this.parent.GetMethods(bindingAttr);
ArrayList arrayList = new ArrayList(array.Length);
bool flag = (bindingAttr & BindingFlags.FlattenHierarchy) != BindingFlags.Default;
foreach (MethodInfo methodInfo in array)
{
MethodAttributes methodAttributes = methodInfo.Attributes;
if (!methodInfo.IsStatic || flag)
{
bool flag2;
switch (methodAttributes & MethodAttributes.MemberAccessMask)
{
case MethodAttributes.Private:
flag2 = false;
break;
case MethodAttributes.FamANDAssem:
case MethodAttributes.Family:
case MethodAttributes.FamORAssem:
goto IL_B6;
case MethodAttributes.Assembly:
flag2 = (bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default;
break;
case MethodAttributes.Public:
flag2 = (bindingAttr & BindingFlags.Public) != BindingFlags.Default;
break;
default:
goto IL_B6;
}
IL_C6:
if (flag2)
{
arrayList.Add(methodInfo);
goto IL_D6;
}
goto IL_D6;
IL_B6:
flag2 = (bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default;
goto IL_C6;
}
IL_D6:;
}
if (this.methods == null)
{
array2 = new MethodInfo[arrayList.Count];
arrayList.CopyTo(array2);
}
else
{
array2 = new MethodInfo[this.methods.Length + arrayList.Count];
arrayList.CopyTo(array2, 0);
this.methods.CopyTo(array2, arrayList.Count);
}
}
else
{
array2 = this.methods;
}
if (array2 == null)
{
return new MethodInfo[0];
}
ArrayList arrayList2 = new ArrayList();
foreach (MethodInfo methodInfo2 in array2)
{
if (methodInfo2 != null)
{
if (name == null || string.Compare(methodInfo2.Name, name, ignoreCase) == 0)
{
bool flag2 = false;
MethodAttributes methodAttributes = methodInfo2.Attributes;
if ((methodAttributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag2 = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag2 = true;
}
if (flag2)
{
flag2 = false;
if ((methodAttributes & MethodAttributes.Static) != MethodAttributes.PrivateScope)
{
if ((bindingAttr & BindingFlags.Static) != BindingFlags.Default)
{
flag2 = true;
}
}
else if ((bindingAttr & BindingFlags.Instance) != BindingFlags.Default)
{
flag2 = true;
}
if (flag2)
{
arrayList2.Add(methodInfo2);
}
}
}
}
}
MethodInfo[] array4 = new MethodInfo[arrayList2.Count];
arrayList2.CopyTo(array4);
return array4;
}
/// <summary>Returns all the public and non-public methods declared or inherited by this type, as specified.</summary>
/// <returns>Returns an array of <see cref="T:System.Reflection.MethodInfo" /> objects representing the public and non-public methods defined on this type if <paramref name="nonPublic" /> is used; otherwise, only the public methods are returned.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> as in InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001CA4 RID: 7332 RVA: 0x0006C288 File Offset: 0x0006A488
public override MethodInfo[] GetMethods(BindingFlags bindingAttr)
{
return this.GetMethodsByName(null, bindingAttr, false, this);
}
// Token: 0x06001CA5 RID: 7333 RVA: 0x0006C294 File Offset: 0x0006A494
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
this.check_created();
bool flag = (bindingAttr & BindingFlags.IgnoreCase) != BindingFlags.Default;
MethodInfo[] methodsByName = this.GetMethodsByName(name, bindingAttr, flag, this);
MethodInfo methodInfo = null;
int num = ((types == null) ? 0 : types.Length);
int num2 = 0;
foreach (MethodInfo methodInfo2 in methodsByName)
{
if (callConvention == CallingConventions.Any || (methodInfo2.CallingConvention & callConvention) == callConvention)
{
methodInfo = methodInfo2;
num2++;
}
}
if (num2 == 0)
{
return null;
}
if (num2 == 1 && num == 0)
{
return methodInfo;
}
MethodBase[] array2 = new MethodBase[num2];
if (num2 == 1)
{
array2[0] = methodInfo;
}
else
{
num2 = 0;
foreach (MethodInfo methodInfo3 in methodsByName)
{
if (callConvention == CallingConventions.Any || (methodInfo3.CallingConvention & callConvention) == callConvention)
{
array2[num2++] = methodInfo3;
}
}
}
if (types == null)
{
return (MethodInfo)Binder.FindMostDerivedMatch(array2);
}
if (binder == null)
{
binder = Binder.DefaultBinder;
}
return (MethodInfo)binder.SelectMethod(bindingAttr, array2, types, modifiers);
}
/// <summary>Returns the public and non-public nested types that are declared by this type.</summary>
/// <returns>A <see cref="T:System.Type" /> object representing the nested type that matches the specified requirements, if found; otherwise, null.</returns>
/// <param name="name">The <see cref="T:System.String" /> containing the name of the nested type to get. </param>
/// <param name="bindingAttr">A bitmask comprised of one or more <see cref="T:System.Reflection.BindingFlags" /> that specify how the search is conducted.-or- Zero, to conduct a case-sensitive search for public methods. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001CA6 RID: 7334 RVA: 0x0006C3D4 File Offset: 0x0006A5D4
public override Type GetNestedType(string name, BindingFlags bindingAttr)
{
this.check_created();
if (this.subtypes == null)
{
return null;
}
foreach (TypeBuilder typeBuilder in this.subtypes)
{
if (typeBuilder.is_created)
{
if ((typeBuilder.attrs & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic)
{
if ((bindingAttr & BindingFlags.Public) == BindingFlags.Default)
{
goto IL_7C;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) == BindingFlags.Default)
{
goto IL_7C;
}
if (typeBuilder.Name == name)
{
return typeBuilder.created;
}
}
IL_7C:;
}
return null;
}
/// <summary>Returns the public and non-public nested types that are declared or inherited by this type.</summary>
/// <returns>An array of <see cref="T:System.Type" /> objects representing all the types nested within the current <see cref="T:System.Type" /> that match the specified binding constraints.An empty array of type <see cref="T:System.Type" />, if no types are nested within the current <see cref="T:System.Type" />, or if none of the nested types match the binding constraints.</returns>
/// <param name="bindingAttr">This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" />, as in InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001CA7 RID: 7335 RVA: 0x0006C46C File Offset: 0x0006A66C
public override Type[] GetNestedTypes(BindingFlags bindingAttr)
{
if (!this.is_created && !this.IsCompilerContext)
{
throw new NotSupportedException();
}
ArrayList arrayList = new ArrayList();
if (this.subtypes == null)
{
return Type.EmptyTypes;
}
foreach (TypeBuilder typeBuilder in this.subtypes)
{
bool flag = false;
if ((typeBuilder.attrs & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
arrayList.Add(typeBuilder);
}
}
Type[] array2 = new Type[arrayList.Count];
arrayList.CopyTo(array2);
return array2;
}
/// <summary>Returns all the public and non-public properties declared or inherited by this type, as specified.</summary>
/// <returns>Returns an array of PropertyInfo objects representing the public and non-public properties defined on this type if <paramref name="nonPublic" /> is used; otherwise, only the public properties are returned.</returns>
/// <param name="bindingAttr">This invocation attribute. This must be a bit flag from <see cref="T:System.Reflection.BindingFlags" /> : InvokeMethod, NonPublic, and so on. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
/// </PermissionSet>
// Token: 0x06001CA8 RID: 7336 RVA: 0x0006C528 File Offset: 0x0006A728
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr)
{
if (this.is_created)
{
return this.created.GetProperties(bindingAttr);
}
if (this.properties == null)
{
return new PropertyInfo[0];
}
ArrayList arrayList = new ArrayList();
foreach (PropertyBuilder propertyInfo in this.properties)
{
bool flag = false;
MethodInfo methodInfo = propertyInfo.GetGetMethod(true);
if (methodInfo == null)
{
methodInfo = propertyInfo.GetSetMethod(true);
}
if (methodInfo != null)
{
MethodAttributes attributes = methodInfo.Attributes;
if ((attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public)
{
if ((bindingAttr & BindingFlags.Public) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.NonPublic) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
flag = false;
if ((attributes & MethodAttributes.Static) != MethodAttributes.PrivateScope)
{
if ((bindingAttr & BindingFlags.Static) != BindingFlags.Default)
{
flag = true;
}
}
else if ((bindingAttr & BindingFlags.Instance) != BindingFlags.Default)
{
flag = true;
}
if (flag)
{
arrayList.Add(propertyInfo);
}
}
}
}
PropertyInfo[] array2 = new PropertyInfo[arrayList.Count];
arrayList.CopyTo(array2);
return array2;
}
// Token: 0x06001CA9 RID: 7337 RVA: 0x0006C638 File Offset: 0x0006A838
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
{
throw this.not_supported();
}
// Token: 0x06001CAA RID: 7338 RVA: 0x0006C640 File Offset: 0x0006A840
protected override bool HasElementTypeImpl()
{
return this.is_created && this.created.HasElementType;
}
/// <summary>Invokes the specified member. The method that is to be invoked must be accessible and provide the most specific match with the specified argument list, under the constraints of the specified binder and invocation attributes.</summary>
/// <returns>Returns the return value of the invoked member.</returns>
/// <param name="name">The name of the member to invoke. This can be a constructor, method, property, or field. A suitable invocation attribute must be specified. Note that it is possible to invoke the default member of a class by passing an empty string as the name of the member. </param>
/// <param name="invokeAttr">The invocation attribute. This must be a bit flag from BindingFlags. </param>
/// <param name="binder">An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is null, the default binder is used. See <see cref="T:System.Reflection.Binder" />. </param>
/// <param name="target">The object on which to invoke the specified member. If the member is static, this parameter is ignored. </param>
/// <param name="args">An argument list. This is an array of Objects that contains the number, order, and type of the parameters of the member to be invoked. If there are no parameters this should be null. </param>
/// <param name="modifiers">An array of the same length as <paramref name="args" /> with elements that represent the attributes associated with the arguments of the member to be invoked. A parameter has attributes associated with it in the metadata. They are used by various interoperability services. See the metadata specs for more details. </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. (Note that this is necessary to, for example, convert a String that represents 1000 to a Double value, since 1000 is represented differently by different cultures.) </param>
/// <param name="namedParameters">Each parameter in the <paramref name="namedParameters" /> array gets the value in the corresponding element in the <paramref name="args" /> array. If the length of <paramref name="args" /> is greater than the length of <paramref name="namedParameters" />, the remaining argument values are passed in order. </param>
/// <exception cref="T:System.NotSupportedException">This method is not currently supported for incomplete types. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
/// </PermissionSet>
// Token: 0x06001CAB RID: 7339 RVA: 0x0006C65C File Offset: 0x0006A85C
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters)
{
this.check_created();
return this.created.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
}
// Token: 0x06001CAC RID: 7340 RVA: 0x0006C688 File Offset: 0x0006A888
protected override bool IsArrayImpl()
{
return false;
}
// Token: 0x06001CAD RID: 7341 RVA: 0x0006C68C File Offset: 0x0006A88C
protected override bool IsByRefImpl()
{
return false;
}
// Token: 0x06001CAE RID: 7342 RVA: 0x0006C690 File Offset: 0x0006A890
protected override bool IsCOMObjectImpl()
{
return (this.GetAttributeFlagsImpl() & TypeAttributes.Import) != TypeAttributes.NotPublic;
}
// Token: 0x06001CAF RID: 7343 RVA: 0x0006C6A4 File Offset: 0x0006A8A4
protected override bool IsPointerImpl()
{
return false;
}
// Token: 0x06001CB0 RID: 7344 RVA: 0x0006C6A8 File Offset: 0x0006A8A8
protected override bool IsPrimitiveImpl()
{
return false;
}
// Token: 0x06001CB1 RID: 7345 RVA: 0x0006C6AC File Offset: 0x0006A8AC
protected override bool IsValueTypeImpl()
{
return (Type.type_is_subtype_of(this, this.pmodule.assemblyb.corlib_value_type, false) || Type.type_is_subtype_of(this, typeof(ValueType), false)) && this != this.pmodule.assemblyb.corlib_value_type && this != this.pmodule.assemblyb.corlib_enum_type;
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents a one-dimensional array of the current type, with a lower bound of zero.</summary>
/// <returns>A <see cref="T:System.Type" /> object representing a one-dimensional array type whose element type is the current type, with a lower bound of zero.</returns>
// Token: 0x06001CB2 RID: 7346 RVA: 0x0006C71C File Offset: 0x0006A91C
public override Type MakeArrayType()
{
return new ArrayType(this, 0);
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents an array of the current type, with the specified number of dimensions.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents a one-dimensional array of the current type.</returns>
/// <param name="rank">The number of dimensions for the array. </param>
/// <exception cref="T:System.IndexOutOfRangeException">
/// <paramref name="rank" /> is not a valid array dimension.</exception>
// Token: 0x06001CB3 RID: 7347 RVA: 0x0006C728 File Offset: 0x0006A928
public override Type MakeArrayType(int rank)
{
if (rank < 1)
{
throw new IndexOutOfRangeException();
}
return new ArrayType(this, rank);
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents the current type when passed as a ref parameter (ByRef in Visual Basic).</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the current type when passed as a ref parameter (ByRef in Visual Basic).</returns>
// Token: 0x06001CB4 RID: 7348 RVA: 0x0006C740 File Offset: 0x0006A940
public override Type MakeByRefType()
{
return new ByRefType(this);
}
/// <summary>Substitutes the elements of an array of types for the type parameters of the current generic type definition, and returns the resulting constructed type.</summary>
/// <returns>A <see cref="T:System.Type" /> representing the constructed type formed by substituting the elements of <paramref name="typeArguments" /> for the type parameters of the current generic type. </returns>
/// <param name="typeArguments">An array of types to be substituted for the type parameters of the current generic type definition.</param>
/// <exception cref="T:System.InvalidOperationException">The current type does not represent the definition of a generic type. That is, <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> returns false. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="typeArguments" /> is null.-or- Any element of <paramref name="typeArguments" /> is null. </exception>
/// <exception cref="T:System.ArgumentException">Any element of <paramref name="typeArguments" /> does not satisfy the constraints specified for the corresponding type parameter of the current generic type. </exception>
// Token: 0x06001CB5 RID: 7349 RVA: 0x0006C748 File Offset: 0x0006A948
[MonoTODO]
public override Type MakeGenericType(params Type[] typeArguments)
{
return base.MakeGenericType(typeArguments);
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents the type of an unmanaged pointer to the current type.</summary>
/// <returns>A <see cref="T:System.Type" /> object that represents the type of an unmanaged pointer to the current type.</returns>
// Token: 0x06001CB6 RID: 7350 RVA: 0x0006C754 File Offset: 0x0006A954
public override Type MakePointerType()
{
return new PointerType(this);
}
/// <summary>Not supported in dynamic modules.</summary>
/// <returns>Read-only.</returns>
/// <exception cref="T:System.NotSupportedException">Not supported in dynamic modules. </exception>
// Token: 0x17000522 RID: 1314
// (get) Token: 0x06001CB7 RID: 7351 RVA: 0x0006C75C File Offset: 0x0006A95C
public override RuntimeTypeHandle TypeHandle
{
get
{
this.check_created();
return this.created.TypeHandle;
}
}
// Token: 0x06001CB8 RID: 7352 RVA: 0x0006C770 File Offset: 0x0006A970
internal void SetCharSet(TypeAttributes ta)
{
this.attrs = ta;
}
/// <summary>Set a custom attribute using a custom attribute builder.</summary>
/// <param name="customBuilder">An instance of a helper class to define the custom attribute. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="customBuilder" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false.</exception>
// Token: 0x06001CB9 RID: 7353 RVA: 0x0006C77C File Offset: 0x0006A97C
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
if (customBuilder == null)
{
throw new ArgumentNullException("customBuilder");
}
string fullName = customBuilder.Ctor.ReflectedType.FullName;
if (fullName == "System.Runtime.InteropServices.StructLayoutAttribute")
{
byte[] data = customBuilder.Data;
int num = (int)data[2];
num |= (int)data[3] << 8;
this.attrs &= ~TypeAttributes.LayoutMask;
switch (num)
{
case 0:
this.attrs |= TypeAttributes.SequentialLayout;
goto IL_B8;
case 2:
this.attrs |= TypeAttributes.ExplicitLayout;
goto IL_B8;
case 3:
this.attrs |= TypeAttributes.NotPublic;
goto IL_B8;
}
throw new Exception("Error in customattr");
IL_B8:
string fullName2 = customBuilder.Ctor.GetParameters()[0].ParameterType.FullName;
int num2 = 6;
if (fullName2 == "System.Int16")
{
num2 = 4;
}
int num3 = (int)data[num2++];
num3 |= (int)data[num2++] << 8;
int i = 0;
while (i < num3)
{
num2++;
byte b = data[num2++];
int num4;
if (b == 85)
{
num4 = CustomAttributeBuilder.decode_len(data, num2, out num2);
CustomAttributeBuilder.string_from_bytes(data, num2, num4);
num2 += num4;
}
num4 = CustomAttributeBuilder.decode_len(data, num2, out num2);
string text = CustomAttributeBuilder.string_from_bytes(data, num2, num4);
num2 += num4;
int num5 = (int)data[num2++];
num5 |= (int)data[num2++] << 8;
num5 |= (int)data[num2++] << 16;
num5 |= (int)data[num2++] << 24;
string text2 = text;
switch (text2)
{
case "CharSet":
switch (num5)
{
case 1:
case 2:
this.attrs &= ~TypeAttributes.StringFormatMask;
break;
case 3:
this.attrs &= ~TypeAttributes.AutoClass;
this.attrs |= TypeAttributes.UnicodeClass;
break;
case 4:
this.attrs &= ~TypeAttributes.UnicodeClass;
this.attrs |= TypeAttributes.AutoClass;
break;
}
break;
case "Pack":
this.packing_size = (PackingSize)num5;
break;
case "Size":
this.class_size = num5;
break;
}
IL_2C7:
i++;
continue;
goto IL_2C7;
}
return;
}
if (fullName == "System.Runtime.CompilerServices.SpecialNameAttribute")
{
this.attrs |= TypeAttributes.SpecialName;
return;
}
if (fullName == "System.SerializableAttribute")
{
this.attrs |= TypeAttributes.Serializable;
return;
}
if (fullName == "System.Runtime.InteropServices.ComImportAttribute")
{
this.attrs |= TypeAttributes.Import;
return;
}
if (fullName == "System.Security.SuppressUnmanagedCodeSecurityAttribute")
{
this.attrs |= TypeAttributes.HasSecurity;
}
if (this.cattrs != null)
{
CustomAttributeBuilder[] array = new CustomAttributeBuilder[this.cattrs.Length + 1];
this.cattrs.CopyTo(array, 0);
array[this.cattrs.Length] = customBuilder;
this.cattrs = array;
}
else
{
this.cattrs = new CustomAttributeBuilder[1];
this.cattrs[0] = customBuilder;
}
}
/// <summary>Sets a custom attribute using a specified custom attribute blob.</summary>
/// <param name="con">The constructor for the custom attribute. </param>
/// <param name="binaryAttribute">A byte blob representing the attributes. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="con" /> or <paramref name="binaryAttribute" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false.</exception>
// Token: 0x06001CBA RID: 7354 RVA: 0x0006CB44 File Offset: 0x0006AD44
[ComVisible(true)]
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute));
}
/// <summary>Adds a new event to the type, with the given name, attributes and event type.</summary>
/// <returns>The defined event.</returns>
/// <param name="name">The name of the event. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="attributes">The attributes of the event. </param>
/// <param name="eventtype">The type of the event. </param>
/// <exception cref="T:System.ArgumentException">The length of <paramref name="name" /> is zero. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null.-or- <paramref name="eventtype" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001CBB RID: 7355 RVA: 0x0006CB54 File Offset: 0x0006AD54
public EventBuilder DefineEvent(string name, EventAttributes attributes, Type eventtype)
{
this.check_name("name", name);
if (eventtype == null)
{
throw new ArgumentNullException("type");
}
this.check_not_created();
EventBuilder eventBuilder = new EventBuilder(this, name, attributes, eventtype);
if (this.events != null)
{
EventBuilder[] array = new EventBuilder[this.events.Length + 1];
Array.Copy(this.events, array, this.events.Length);
array[this.events.Length] = eventBuilder;
this.events = array;
}
else
{
this.events = new EventBuilder[1];
this.events[0] = eventBuilder;
}
return eventBuilder;
}
/// <summary>Defines initialized data field in the .sdata section of the portable executable (PE) file.</summary>
/// <returns>A field to reference the data.</returns>
/// <param name="name">The name used to refer to the data. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="data">The blob of data. </param>
/// <param name="attributes">The attributes for the field. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="name" /> is zero.-or- The size of the data is less than or equal to zero, or greater than or equal to 0x3f0000. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> or <paramref name="data" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">
/// <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> has been previously called. </exception>
// Token: 0x06001CBC RID: 7356 RVA: 0x0006CBEC File Offset: 0x0006ADEC
public FieldBuilder DefineInitializedData(string name, byte[] data, FieldAttributes attributes)
{
if (data == null)
{
throw new ArgumentNullException("data");
}
FieldBuilder fieldBuilder = this.DefineUninitializedData(name, data.Length, attributes);
fieldBuilder.SetRVAData(data);
return fieldBuilder;
}
/// <summary>Defines an uninitialized data field in the .sdata section of the portable executable (PE) file.</summary>
/// <returns>A field to reference the data.</returns>
/// <param name="name">The name used to refer to the data. <paramref name="name" /> cannot contain embedded nulls. </param>
/// <param name="size">The size of the data field. </param>
/// <param name="attributes">The attributes for the field. </param>
/// <exception cref="T:System.ArgumentException">Length of <paramref name="name" /> is zero.-or- <paramref name="size" /> is less than or equal to zero, or greater than or equal to 0x003f0000. </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="name" /> is null. </exception>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />. </exception>
// Token: 0x06001CBD RID: 7357 RVA: 0x0006CC20 File Offset: 0x0006AE20
public FieldBuilder DefineUninitializedData(string name, int size, FieldAttributes attributes)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
if (name.Length == 0)
{
throw new ArgumentException("Empty name is not legal", "name");
}
if (size <= 0 || size > 4128768)
{
throw new ArgumentException("Data size must be > 0 and < 0x3f0000");
}
this.check_not_created();
string text = "$ArrayType$" + size;
Type type = this.pmodule.GetRegisteredType(this.fullname + "+" + text);
if (type == null)
{
TypeBuilder typeBuilder = this.DefineNestedType(text, TypeAttributes.Public | TypeAttributes.NestedPublic | TypeAttributes.ExplicitLayout | TypeAttributes.Sealed, this.pmodule.assemblyb.corlib_value_type, null, PackingSize.Size1, size);
typeBuilder.CreateType();
type = typeBuilder;
}
return this.DefineField(name, type, attributes | FieldAttributes.Static | FieldAttributes.HasFieldRVA);
}
/// <summary>Returns the type token of this type.</summary>
/// <returns>Read-only. Returns the TypeToken of this type.</returns>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.</exception>
// Token: 0x17000523 RID: 1315
// (get) Token: 0x06001CBE RID: 7358 RVA: 0x0006CCEC File Offset: 0x0006AEEC
public TypeToken TypeToken
{
get
{
return new TypeToken(33554432 | this.table_idx);
}
}
/// <summary>Sets the base type of the type currently under construction.</summary>
/// <param name="parent">The new base type. </param>
/// <exception cref="T:System.InvalidOperationException">The type was previously created using <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" />.-or-<paramref name="parent" /> is null, and the current instance represents an interface whose attributes do not include <see cref="F:System.Reflection.TypeAttributes.Abstract" />.-or-For the current dynamic type, the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> property is true, but the <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericTypeDefinition" /> property is false. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="parent" /> is an interface. This exception condition is new in the .NET Framework version 2.0. </exception>
// Token: 0x06001CBF RID: 7359 RVA: 0x0006CD00 File Offset: 0x0006AF00
public void SetParent(Type parent)
{
this.check_not_created();
if (parent == null)
{
if ((this.attrs & TypeAttributes.ClassSemanticsMask) != TypeAttributes.NotPublic)
{
if ((this.attrs & TypeAttributes.Abstract) == TypeAttributes.NotPublic)
{
throw new InvalidOperationException("Interface must be declared abstract.");
}
this.parent = null;
}
else
{
this.parent = typeof(object);
}
}
else
{
this.parent = parent;
}
this.setup_internal_class(this);
}
// Token: 0x06001CC0 RID: 7360 RVA: 0x0006CD74 File Offset: 0x0006AF74
internal int get_next_table_index(object obj, int table, bool inc)
{
return this.pmodule.get_next_table_index(obj, table, inc);
}
/// <summary>Returns an interface mapping for the requested interface.</summary>
/// <returns>Returns the requested interface mapping.</returns>
/// <param name="interfaceType">The <see cref="T:System.Type" /> of the interface for which the mapping is to be retrieved. </param>
/// <exception cref="T:System.NotSupportedException">This method is not implemented for incomplete types. </exception>
// Token: 0x06001CC1 RID: 7361 RVA: 0x0006CD84 File Offset: 0x0006AF84
[ComVisible(true)]
public override InterfaceMapping GetInterfaceMap(Type interfaceType)
{
if (this.created == null)
{
throw new NotSupportedException("This method is not implemented for incomplete types.");
}
return this.created.GetInterfaceMap(interfaceType);
}
// Token: 0x17000524 RID: 1316
// (get) Token: 0x06001CC2 RID: 7362 RVA: 0x0006CDB4 File Offset: 0x0006AFB4
internal bool IsCompilerContext
{
get
{
return this.pmodule.assemblyb.IsCompilerContext;
}
}
// Token: 0x17000525 RID: 1317
// (get) Token: 0x06001CC3 RID: 7363 RVA: 0x0006CDC8 File Offset: 0x0006AFC8
internal bool is_created
{
get
{
return this.created != null;
}
}
// Token: 0x06001CC4 RID: 7364 RVA: 0x0006CDD8 File Offset: 0x0006AFD8
private Exception not_supported()
{
return new NotSupportedException("The invoked member is not supported in a dynamic module.");
}
// Token: 0x06001CC5 RID: 7365 RVA: 0x0006CDE4 File Offset: 0x0006AFE4
private void check_not_created()
{
if (this.is_created)
{
throw new InvalidOperationException("Unable to change after type has been created.");
}
}
// Token: 0x06001CC6 RID: 7366 RVA: 0x0006CDFC File Offset: 0x0006AFFC
private void check_created()
{
if (!this.is_created)
{
throw this.not_supported();
}
}
// Token: 0x06001CC7 RID: 7367 RVA: 0x0006CE10 File Offset: 0x0006B010
private void check_name(string argName, string name)
{
if (name == null)
{
throw new ArgumentNullException(argName);
}
if (name.Length == 0)
{
throw new ArgumentException("Empty name is not legal", argName);
}
if (name[0] == '\0')
{
throw new ArgumentException("Illegal name", argName);
}
}
/// <summary>Returns the name of the type excluding the namespace.</summary>
/// <returns>Read-only. The name of the type excluding the namespace.</returns>
// Token: 0x06001CC8 RID: 7368 RVA: 0x0006CE5C File Offset: 0x0006B05C
public override string ToString()
{
return this.FullName;
}
/// <summary>Determines whether an instance of the current <see cref="T:System.Type" /> can be assigned from an instance of the specified Type.</summary>
/// <returns>true if the <paramref name="c" /> parameter and the current <see cref="T:System.Type" /> represent the same type, or if the current Type is in the inheritance hierarchy of <paramref name="c" />, or if the current Type is an interface that <paramref name="c" /> supports. false if none of these conditions are the case, or if <paramref name="c" /> is a null reference (Nothing in Visual Basic).</returns>
/// <param name="c">The Type to compare with the current Type. </param>
// Token: 0x06001CC9 RID: 7369 RVA: 0x0006CE64 File Offset: 0x0006B064
[MonoTODO]
public override bool IsAssignableFrom(Type c)
{
return base.IsAssignableFrom(c);
}
/// <summary>Determines whether this type is derived from a specified type.</summary>
/// <returns>Read-only. Returns true if this type is the same as the type <paramref name="c" />, or is a subtype of type <paramref name="c" />; otherwise, false.</returns>
/// <param name="c">A <see cref="T:System.Type" /> that is to be checked. </param>
// Token: 0x06001CCA RID: 7370 RVA: 0x0006CE70 File Offset: 0x0006B070
[ComVisible(true)]
[MonoTODO]
public override bool IsSubclassOf(Type c)
{
return base.IsSubclassOf(c);
}
// Token: 0x06001CCB RID: 7371 RVA: 0x0006CE7C File Offset: 0x0006B07C
[MonoTODO("arrays")]
internal bool IsAssignableTo(Type c)
{
if (c == this)
{
return true;
}
if (c.IsInterface)
{
if (this.parent != null && this.is_created && c.IsAssignableFrom(this.parent))
{
return true;
}
if (this.interfaces == null)
{
return false;
}
foreach (Type type in this.interfaces)
{
if (c.IsAssignableFrom(type))
{
return true;
}
}
if (!this.is_created)
{
return false;
}
}
if (this.parent == null)
{
return c == typeof(object);
}
return c.IsAssignableFrom(this.parent);
}
/// <summary>Returns a value that indicates whether the current dynamic type has been created.</summary>
/// <returns>true if the <see cref="M:System.Reflection.Emit.TypeBuilder.CreateType" /> method has been called; otherwise, false. </returns>
// Token: 0x06001CCC RID: 7372 RVA: 0x0006CF34 File Offset: 0x0006B134
public bool IsCreated()
{
return this.is_created;
}
/// <summary>Returns an array of <see cref="T:System.Type" /> objects representing the type arguments of a generic type or the type parameters of a generic type definition.</summary>
/// <returns>An array of <see cref="T:System.Type" /> objects. The elements of the array represent the type arguments of a generic type or the type parameters of a generic type definition.</returns>
// Token: 0x06001CCD RID: 7373 RVA: 0x0006CF3C File Offset: 0x0006B13C
public override Type[] GetGenericArguments()
{
if (this.generic_params == null)
{
return null;
}
Type[] array = new Type[this.generic_params.Length];
this.generic_params.CopyTo(array, 0);
return array;
}
/// <summary>Returns a <see cref="T:System.Type" /> object that represents a generic type definition from which the current type can be obtained.</summary>
/// <returns>A <see cref="T:System.Type" /> object representing a generic type definition from which the current type can be obtained.</returns>
/// <exception cref="T:System.InvalidOperationException">The current type is not generic. That is, <see cref="P:System.Reflection.Emit.TypeBuilder.IsGenericType" /> returns false.</exception>
// Token: 0x06001CCE RID: 7374 RVA: 0x0006CF74 File Offset: 0x0006B174
public override Type GetGenericTypeDefinition()
{
if (this.generic_params == null)
{
throw new InvalidOperationException("Type is not generic");
}
return this;
}
// Token: 0x17000526 RID: 1318
// (get) Token: 0x06001CCF RID: 7375 RVA: 0x0006CF90 File Offset: 0x0006B190
public override bool ContainsGenericParameters
{
get
{
return this.generic_params != null;
}
}
/// <summary>Gets a value indicating whether the current type is a generic type parameter.</summary>
/// <returns>true if the current <see cref="T:System.Reflection.Emit.TypeBuilder" /> object represents a generic type parameter; otherwise, false.</returns>
// Token: 0x17000527 RID: 1319
// (get) Token: 0x06001CD0 RID: 7376
public override extern bool IsGenericParameter
{
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
/// <summary>Gets a value that indicates the covariance and special constraints of the current generic type parameter. </summary>
/// <returns>A bitwise combination of <see cref="T:System.Reflection.GenericParameterAttributes" /> values that describes the covariance and special constraints of the current generic type parameter.</returns>
// Token: 0x17000528 RID: 1320
// (get) Token: 0x06001CD1 RID: 7377 RVA: 0x0006CFA0 File Offset: 0x0006B1A0
public override GenericParameterAttributes GenericParameterAttributes
{
get
{
return GenericParameterAttributes.None;
}
}
/// <summary>Gets a value indicating whether the current <see cref="T:System.Reflection.Emit.TypeBuilder" /> represents a generic type definition from which other generic types can be constructed.</summary>
/// <returns>true if this <see cref="T:System.Reflection.Emit.TypeBuilder" /> object represents a generic type definition; otherwise, false.</returns>
// Token: 0x17000529 RID: 1321
// (get) Token: 0x06001CD2 RID: 7378 RVA: 0x0006CFA4 File Offset: 0x0006B1A4
public override bool IsGenericTypeDefinition
{
get
{
return this.generic_params != null;
}
}
/// <summary>Gets a value indicating whether the current type is a generic type. </summary>
/// <returns>true if the type represented by the current <see cref="T:System.Reflection.Emit.TypeBuilder" /> object is generic; otherwise, false.</returns>
// Token: 0x1700052A RID: 1322
// (get) Token: 0x06001CD3 RID: 7379 RVA: 0x0006CFB4 File Offset: 0x0006B1B4
public override bool IsGenericType
{
get
{
return this.IsGenericTypeDefinition;
}
}
/// <summary>Gets the position of a type parameter in the type parameter list of the generic type that declared the parameter.</summary>
/// <returns>If the current <see cref="T:System.Reflection.Emit.TypeBuilder" /> object represents a generic type parameter, the position of the type parameter in the type parameter list of the generic type that declared the parameter; otherwise, undefined.</returns>
// Token: 0x1700052B RID: 1323
// (get) Token: 0x06001CD4 RID: 7380 RVA: 0x0006CFBC File Offset: 0x0006B1BC
[MonoTODO]
public override int GenericParameterPosition
{
get
{
return 0;
}
}
/// <summary>Gets the method that declared the current generic type parameter.</summary>
/// <returns>A <see cref="T:System.Reflection.MethodBase" /> that represents the method that declared the current type, if the current type is a generic type parameter; otherwise, null.</returns>
// Token: 0x1700052C RID: 1324
// (get) Token: 0x06001CD5 RID: 7381 RVA: 0x0006CFC0 File Offset: 0x0006B1C0
public override MethodBase DeclaringMethod
{
get
{
return null;
}
}
/// <summary>Defines the generic type parameters for the current type, specifying their number and their names, and returns an array of <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> objects that can be used to set their constraints.</summary>
/// <returns>An array of <see cref="T:System.Reflection.Emit.GenericTypeParameterBuilder" /> objects that can be used to define the constraints of the generic type parameters for the current type.</returns>
/// <param name="names">An array of names for the generic type parameters.</param>
/// <exception cref="T:System.InvalidOperationException">Generic type parameters have already been defined for this type.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="names" /> is null.-or-An element of <paramref name="names" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="names" /> is an empty array.</exception>
// Token: 0x06001CD6 RID: 7382 RVA: 0x0006CFC4 File Offset: 0x0006B1C4
public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names)
{
if (names == null)
{
throw new ArgumentNullException("names");
}
if (names.Length == 0)
{
throw new ArgumentException("names");
}
this.setup_generic_class();
this.generic_params = new GenericTypeParameterBuilder[names.Length];
for (int i = 0; i < names.Length; i++)
{
string text = names[i];
if (text == null)
{
throw new ArgumentNullException("names");
}
this.generic_params[i] = new GenericTypeParameterBuilder(this, null, text, i);
}
return this.generic_params;
}
/// <summary>Returns the constructor of the specified constructed generic type that corresponds to the specified constructor of the generic type definition. </summary>
/// <returns>A <see cref="T:System.Reflection.ConstructorInfo" /> object that represents the constructor of <paramref name="type" /> corresponding to <paramref name="constructor" />, which specifies a constructor belonging to the generic type definition of <paramref name="type" />.</returns>
/// <param name="type">The constructed generic type whose constructor is returned.</param>
/// <param name="constructor">A constructor on the generic type definition of <paramref name="type" />, which specifies which constructor of <paramref name="type" /> to return.</param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="type" /> does not represent a generic type. -or-<paramref name="type" /> is not of type <see cref="T:System.Reflection.Emit.TypeBuilder" />.-or-The declaring type of <paramref name="constructor" /> is not a generic type definition. -or-The declaring type of <paramref name="constructor" /> is not the generic type definition of <paramref name="type" />.</exception>
// Token: 0x06001CD7 RID: 7383 RVA: 0x0006D04C File Offset: 0x0006B24C
public static ConstructorInfo GetConstructor(Type type, ConstructorInfo constructor)
{
if (type == null)
{
throw new ArgumentException("Type is not generic", "type");
}
ConstructorInfo constructor2 = type.GetConstructor(constructor);
if (constructor2 == null)
{
throw new ArgumentException("constructor not found");
}
return constructor2;
}
// Token: 0x06001CD8 RID: 7384 RVA: 0x0006D08C File Offset: 0x0006B28C
private static bool IsValidGetMethodType(Type type)
{
if (type is TypeBuilder || type is MonoGenericClass)
{
return true;
}
if (type.Module is ModuleBuilder)
{
return true;
}
if (type.IsGenericParameter)
{
return false;
}
Type[] genericArguments = type.GetGenericArguments();
if (genericArguments == null)
{
return false;
}
for (int i = 0; i < genericArguments.Length; i++)
{
if (TypeBuilder.IsValidGetMethodType(genericArguments[i]))
{
return true;
}
}
return false;
}
/// <summary>Returns the method of the specified constructed generic type that corresponds to the specified method of the generic type definition. </summary>
/// <returns>A <see cref="T:System.Reflection.MethodInfo" /> object that represents the method of <paramref name="type" /> corresponding to <paramref name="method" />, which specifies a method belonging to the generic type definition of <paramref name="type" />.</returns>
/// <param name="type">The constructed generic type whose method is returned.</param>
/// <param name="method">A method on the generic type definition of <paramref name="type" />, which specifies which method of <paramref name="type" /> to return.</param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="method" /> is a generic method that is not a generic method definition.-or-<paramref name="type" /> does not represent a generic type.-or-<paramref name="type" /> is not of type <see cref="T:System.Reflection.Emit.TypeBuilder" />.-or-The declaring type of <paramref name="method" /> is not a generic type definition. -or-The declaring type of <paramref name="method" /> is not the generic type definition of <paramref name="type" />.</exception>
// Token: 0x06001CD9 RID: 7385 RVA: 0x0006D104 File Offset: 0x0006B304
public static MethodInfo GetMethod(Type type, MethodInfo method)
{
if (!TypeBuilder.IsValidGetMethodType(type))
{
throw new ArgumentException("type is not TypeBuilder but " + type.GetType(), "type");
}
if (!type.IsGenericType)
{
throw new ArgumentException("type is not a generic type", "type");
}
if (!method.DeclaringType.IsGenericTypeDefinition)
{
throw new ArgumentException("method declaring type is not a generic type definition", "method");
}
if (method.DeclaringType != type.GetGenericTypeDefinition())
{
throw new ArgumentException("method declaring type is not the generic type definition of type", "method");
}
MethodInfo method2 = type.GetMethod(method);
if (method2 == null)
{
throw new ArgumentException(string.Format("method {0} not found in type {1}", method.Name, type));
}
return method2;
}
/// <summary>Returns the field of the specified constructed generic type that corresponds to the specified field of the generic type definition. </summary>
/// <returns>A <see cref="T:System.Reflection.FieldInfo" /> object that represents the field of <paramref name="type" /> corresponding to <paramref name="field" />, which specifies a field belonging to the generic type definition of <paramref name="type" />.</returns>
/// <param name="type">The constructed generic type whose field is returned.</param>
/// <param name="field">A field on the generic type definition of <paramref name="type" />, which specifies which field of <paramref name="type" /> to return.</param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="type" /> does not represent a generic type. -or-<paramref name="type" /> is not of type <see cref="T:System.Reflection.Emit.TypeBuilder" />.-or-The declaring type of <paramref name="field" /> is not a generic type definition. -or-The declaring type of <paramref name="field" /> is not the generic type definition of <paramref name="type" />.</exception>
// Token: 0x06001CDA RID: 7386 RVA: 0x0006D1BC File Offset: 0x0006B3BC
public static FieldInfo GetField(Type type, FieldInfo field)
{
FieldInfo field2 = type.GetField(field);
if (field2 == null)
{
throw new Exception("field not found");
}
return field2;
}
/// <summary>Represents that total size for the type is not specified.</summary>
// Token: 0x040009AC RID: 2476
public const int UnspecifiedTypeSize = 0;
// Token: 0x040009AD RID: 2477
private string tname;
// Token: 0x040009AE RID: 2478
private string nspace;
// Token: 0x040009AF RID: 2479
private Type parent;
// Token: 0x040009B0 RID: 2480
private Type nesting_type;
// Token: 0x040009B1 RID: 2481
internal Type[] interfaces;
// Token: 0x040009B2 RID: 2482
internal int num_methods;
// Token: 0x040009B3 RID: 2483
internal MethodBuilder[] methods;
// Token: 0x040009B4 RID: 2484
internal ConstructorBuilder[] ctors;
// Token: 0x040009B5 RID: 2485
internal PropertyBuilder[] properties;
// Token: 0x040009B6 RID: 2486
internal int num_fields;
// Token: 0x040009B7 RID: 2487
internal FieldBuilder[] fields;
// Token: 0x040009B8 RID: 2488
internal EventBuilder[] events;
// Token: 0x040009B9 RID: 2489
private CustomAttributeBuilder[] cattrs;
// Token: 0x040009BA RID: 2490
internal TypeBuilder[] subtypes;
// Token: 0x040009BB RID: 2491
internal TypeAttributes attrs;
// Token: 0x040009BC RID: 2492
private int table_idx;
// Token: 0x040009BD RID: 2493
private ModuleBuilder pmodule;
// Token: 0x040009BE RID: 2494
private int class_size;
// Token: 0x040009BF RID: 2495
private PackingSize packing_size;
// Token: 0x040009C0 RID: 2496
private IntPtr generic_container;
// Token: 0x040009C1 RID: 2497
private GenericTypeParameterBuilder[] generic_params;
// Token: 0x040009C2 RID: 2498
private RefEmitPermissionSet[] permissions;
// Token: 0x040009C3 RID: 2499
private Type created;
// Token: 0x040009C4 RID: 2500
private string fullname;
// Token: 0x040009C5 RID: 2501
private bool createTypeCalled;
// Token: 0x040009C6 RID: 2502
private Type underlying_type;
}
}
@@ -0,0 +1,13 @@
using System;
namespace System.Reflection.Emit
{
// Token: 0x020001E6 RID: 486
internal enum TypeKind
{
// Token: 0x04000789 RID: 1929
SZARRAY = 29,
// Token: 0x0400078A RID: 1930
ARRAY = 20
}
}
@@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents the Token returned by the metadata to represent a type.</summary>
// Token: 0x0200021C RID: 540
[ComVisible(true)]
[Serializable]
public struct TypeToken
{
// Token: 0x06001CDB RID: 7387 RVA: 0x0006D1E4 File Offset: 0x0006B3E4
internal TypeToken(int val)
{
this.tokValue = val;
}
/// <summary>Checks if the given object is an instance of TypeToken and is equal to this instance.</summary>
/// <returns>true if <paramref name="obj" /> is an instance of TypeToken and is equal to this object; otherwise, false.</returns>
/// <param name="obj">The object to compare with this TypeToken. </param>
// Token: 0x06001CDD RID: 7389 RVA: 0x0006D20C File Offset: 0x0006B40C
public override bool Equals(object obj)
{
bool flag = obj is TypeToken;
if (flag)
{
TypeToken typeToken = (TypeToken)obj;
flag = this.tokValue == typeToken.tokValue;
}
return flag;
}
/// <summary>Indicates whether the current instance is equal to the specified <see cref="T:System.Reflection.Emit.TypeToken" />.</summary>
/// <returns>true if the value of <paramref name="obj" /> is equal to the value of the current instance; otherwise, false.</returns>
/// <param name="obj">The <see cref="T:System.Reflection.Emit.TypeToken" /> to compare to the current instance.</param>
// Token: 0x06001CDE RID: 7390 RVA: 0x0006D244 File Offset: 0x0006B444
public bool Equals(TypeToken obj)
{
return this.tokValue == obj.tokValue;
}
/// <summary>Generates the hash code for this type.</summary>
/// <returns>Returns the hash code for this type.</returns>
// Token: 0x06001CDF RID: 7391 RVA: 0x0006D258 File Offset: 0x0006B458
public override int GetHashCode()
{
return this.tokValue;
}
/// <summary>Retrieves the metadata token for this class.</summary>
/// <returns>Read-only. Retrieves the metadata token of this type.</returns>
// Token: 0x1700052D RID: 1325
// (get) Token: 0x06001CE0 RID: 7392 RVA: 0x0006D260 File Offset: 0x0006B460
public int Token
{
get
{
return this.tokValue;
}
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.TypeToken" /> structures are equal.</summary>
/// <returns>true if <paramref name="a" /> is equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.TypeToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.TypeToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001CE1 RID: 7393 RVA: 0x0006D268 File Offset: 0x0006B468
public static bool operator ==(TypeToken a, TypeToken b)
{
return object.Equals(a, b);
}
/// <summary>Indicates whether two <see cref="T:System.Reflection.Emit.TypeToken" /> structures are not equal.</summary>
/// <returns>true if <paramref name="a" /> is not equal to <paramref name="b" />; otherwise, false.</returns>
/// <param name="a">The <see cref="T:System.Reflection.Emit.TypeToken" /> to compare to <paramref name="b" />.</param>
/// <param name="b">The <see cref="T:System.Reflection.Emit.TypeToken" /> to compare to <paramref name="a" />.</param>
// Token: 0x06001CE2 RID: 7394 RVA: 0x0006D27C File Offset: 0x0006B47C
public static bool operator !=(TypeToken a, TypeToken b)
{
return !object.Equals(a, b);
}
// Token: 0x040009C8 RID: 2504
internal int tokValue;
/// <summary>The default TypeToken with <see cref="P:System.Reflection.Emit.TypeToken.Token" /> value 0.</summary>
// Token: 0x040009C9 RID: 2505
public static readonly TypeToken Empty = default(TypeToken);
}
}
@@ -0,0 +1,217 @@
using System;
using System.Runtime.InteropServices;
namespace System.Reflection.Emit
{
/// <summary>Represents the class that describes how to marshal a field from managed to unmanaged code. This class cannot be inherited.</summary>
// Token: 0x0200021D RID: 541
[ComVisible(true)]
[Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead.")]
[Serializable]
public sealed class UnmanagedMarshal
{
// Token: 0x06001CE3 RID: 7395 RVA: 0x0006D294 File Offset: 0x0006B494
private UnmanagedMarshal(UnmanagedType maint, int cnt)
{
this.count = cnt;
this.t = maint;
this.tbase = maint;
}
// Token: 0x06001CE4 RID: 7396 RVA: 0x0006D2B4 File Offset: 0x0006B4B4
private UnmanagedMarshal(UnmanagedType maint, UnmanagedType elemt)
{
this.count = 0;
this.t = maint;
this.tbase = elemt;
}
/// <summary>Gets an unmanaged base type. This property is read-only.</summary>
/// <returns>An UnmanagedType object.</returns>
/// <exception cref="T:System.ArgumentException">The unmanaged type is not an LPArray or a SafeArray. </exception>
// Token: 0x1700052E RID: 1326
// (get) Token: 0x06001CE5 RID: 7397 RVA: 0x0006D2D4 File Offset: 0x0006B4D4
public UnmanagedType BaseType
{
get
{
if (this.t == UnmanagedType.LPArray || this.t == UnmanagedType.SafeArray)
{
throw new ArgumentException();
}
return this.tbase;
}
}
/// <summary>Gets a number element. This property is read-only.</summary>
/// <returns>An integer indicating the element count.</returns>
/// <exception cref="T:System.ArgumentException">The argument is not an unmanaged element count. </exception>
// Token: 0x1700052F RID: 1327
// (get) Token: 0x06001CE6 RID: 7398 RVA: 0x0006D308 File Offset: 0x0006B508
public int ElementCount
{
get
{
return this.count;
}
}
/// <summary>Indicates an unmanaged type. This property is read-only.</summary>
/// <returns>An <see cref="T:System.Runtime.InteropServices.UnmanagedType" /> object.</returns>
// Token: 0x17000530 RID: 1328
// (get) Token: 0x06001CE7 RID: 7399 RVA: 0x0006D310 File Offset: 0x0006B510
public UnmanagedType GetUnmanagedType
{
get
{
return this.t;
}
}
/// <summary>Gets a GUID. This property is read-only.</summary>
/// <returns>A <see cref="T:System.Guid" /> object.</returns>
/// <exception cref="T:System.ArgumentException">The argument is not a custom marshaler. </exception>
// Token: 0x17000531 RID: 1329
// (get) Token: 0x06001CE8 RID: 7400 RVA: 0x0006D318 File Offset: 0x0006B518
public Guid IIDGuid
{
get
{
return new Guid(this.guid);
}
}
/// <summary>Specifies a fixed-length array (ByValArray) to marshal to unmanaged code.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.UnmanagedMarshal" /> object.</returns>
/// <param name="elemCount">The number of elements in the fixed-length array. </param>
/// <exception cref="T:System.ArgumentException">The argument is not a simple native type. </exception>
// Token: 0x06001CE9 RID: 7401 RVA: 0x0006D328 File Offset: 0x0006B528
public static UnmanagedMarshal DefineByValArray(int elemCount)
{
return new UnmanagedMarshal(UnmanagedType.ByValArray, elemCount);
}
/// <summary>Specifies a string in a fixed array buffer (ByValTStr) to marshal to unmanaged code.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.UnmanagedMarshal" /> object.</returns>
/// <param name="elemCount">The number of elements in the fixed array buffer. </param>
/// <exception cref="T:System.ArgumentException">The argument is not a simple native type. </exception>
// Token: 0x06001CEA RID: 7402 RVA: 0x0006D334 File Offset: 0x0006B534
public static UnmanagedMarshal DefineByValTStr(int elemCount)
{
return new UnmanagedMarshal(UnmanagedType.ByValTStr, elemCount);
}
/// <summary>Specifies an LPArray to marshal to unmanaged code. The length of an LPArray is determined at runtime by the size of the actual marshaled array.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.UnmanagedMarshal" /> object.</returns>
/// <param name="elemType">The unmanaged type to which to marshal the array. </param>
/// <exception cref="T:System.ArgumentException">The argument is not a simple native type. </exception>
// Token: 0x06001CEB RID: 7403 RVA: 0x0006D340 File Offset: 0x0006B540
public static UnmanagedMarshal DefineLPArray(UnmanagedType elemType)
{
return new UnmanagedMarshal(UnmanagedType.LPArray, elemType);
}
/// <summary>Specifies a SafeArray to marshal to unmanaged code.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.UnmanagedMarshal" /> object.</returns>
/// <param name="elemType">The base type or the UnmanagedType of each element of the array. </param>
/// <exception cref="T:System.ArgumentException">The argument is not a simple native type. </exception>
// Token: 0x06001CEC RID: 7404 RVA: 0x0006D34C File Offset: 0x0006B54C
public static UnmanagedMarshal DefineSafeArray(UnmanagedType elemType)
{
return new UnmanagedMarshal(UnmanagedType.SafeArray, elemType);
}
/// <summary>Specifies a given type that is to be marshaled to unmanaged code.</summary>
/// <returns>An <see cref="T:System.Reflection.Emit.UnmanagedMarshal" /> object.</returns>
/// <param name="unmanagedType">The unmanaged type to which the type is to be marshaled. </param>
/// <exception cref="T:System.ArgumentException">The argument is not a simple native type. </exception>
// Token: 0x06001CED RID: 7405 RVA: 0x0006D358 File Offset: 0x0006B558
public static UnmanagedMarshal DefineUnmanagedMarshal(UnmanagedType unmanagedType)
{
return new UnmanagedMarshal(unmanagedType, unmanagedType);
}
// Token: 0x06001CEE RID: 7406 RVA: 0x0006D364 File Offset: 0x0006B564
public static UnmanagedMarshal DefineCustom(Type typeref, string cookie, string mtype, Guid id)
{
UnmanagedMarshal unmanagedMarshal = new UnmanagedMarshal(UnmanagedType.CustomMarshaler, UnmanagedType.CustomMarshaler);
unmanagedMarshal.mcookie = cookie;
unmanagedMarshal.marshaltype = mtype;
unmanagedMarshal.marshaltyperef = typeref;
if (id == Guid.Empty)
{
unmanagedMarshal.guid = string.Empty;
}
else
{
unmanagedMarshal.guid = id.ToString();
}
return unmanagedMarshal;
}
// Token: 0x06001CEF RID: 7407 RVA: 0x0006D3C0 File Offset: 0x0006B5C0
internal static UnmanagedMarshal DefineLPArrayInternal(UnmanagedType elemType, int sizeConst, int sizeParamIndex)
{
return new UnmanagedMarshal(UnmanagedType.LPArray, elemType)
{
count = sizeConst,
param_num = sizeParamIndex,
has_size = true
};
}
// Token: 0x06001CF0 RID: 7408 RVA: 0x0006D3EC File Offset: 0x0006B5EC
internal MarshalAsAttribute ToMarshalAsAttribute()
{
MarshalAsAttribute marshalAsAttribute = new MarshalAsAttribute(this.t);
marshalAsAttribute.ArraySubType = this.tbase;
marshalAsAttribute.MarshalCookie = this.mcookie;
marshalAsAttribute.MarshalType = this.marshaltype;
marshalAsAttribute.MarshalTypeRef = this.marshaltyperef;
if (this.count == -1)
{
marshalAsAttribute.SizeConst = 0;
}
else
{
marshalAsAttribute.SizeConst = this.count;
}
if (this.param_num == -1)
{
marshalAsAttribute.SizeParamIndex = 0;
}
else
{
marshalAsAttribute.SizeParamIndex = (short)this.param_num;
}
return marshalAsAttribute;
}
// Token: 0x040009CA RID: 2506
private int count;
// Token: 0x040009CB RID: 2507
private UnmanagedType t;
// Token: 0x040009CC RID: 2508
private UnmanagedType tbase;
// Token: 0x040009CD RID: 2509
private string guid;
// Token: 0x040009CE RID: 2510
private string mcookie;
// Token: 0x040009CF RID: 2511
private string marshaltype;
// Token: 0x040009D0 RID: 2512
private Type marshaltyperef;
// Token: 0x040009D1 RID: 2513
private int param_num;
// Token: 0x040009D2 RID: 2514
private bool has_size;
}
}