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
{
/// Defines and represents a method (or constructor) on a dynamic class.
// 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;
}
/// Maps a set of names to a corresponding set of dispatch identifiers.
/// Reserved for future use. Must be IID_NULL.
/// Passed-in array of names to be mapped.
/// Count of the names to be mapped.
/// The locale context in which to interpret the names.
/// Caller-allocated array that receives the IDs corresponding to the names.
/// Late-bound access using the COM IDispatch interface is not supported.
// 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();
}
/// Retrieves the type information for an object, which can then be used to get the type information for an interface.
/// The type information to return.
/// The locale identifier for the type information.
/// Receives a pointer to the requested type information object.
/// Late-bound access using the COM IDispatch interface is not supported.
// Token: 0x06001AFA RID: 6906 RVA: 0x0006582C File Offset: 0x00063A2C
void _MethodBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
{
throw new NotImplementedException();
}
/// Retrieves the number of type information interfaces that an object provides (either 0 or 1).
/// Points to a location that receives the number of type information interfaces provided by the object.
/// Late-bound access using the COM IDispatch interface is not supported.
// Token: 0x06001AFB RID: 6907 RVA: 0x00065834 File Offset: 0x00063A34
void _MethodBuilder.GetTypeInfoCount(out uint pcTInfo)
{
throw new NotImplementedException();
}
/// Provides access to properties and methods exposed by an object.
/// Identifies the member.
/// Reserved for future use. Must be IID_NULL.
/// The locale context in which to interpret arguments.
/// Flags describing the context of the call.
/// 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.
/// Pointer to the location where the result is to be stored.
/// Pointer to a structure that contains exception information.
/// The index of the first argument that has an error.
/// Late-bound access using the COM IDispatch interface is not supported.
// 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();
}
/// Not supported for this type.
/// Not supported.
/// The invoked method is not supported in the base class.
// Token: 0x170004C9 RID: 1225
// (get) Token: 0x06001AFD RID: 6909 RVA: 0x00065844 File Offset: 0x00063A44
public override bool ContainsGenericParameters
{
get
{
throw new NotSupportedException();
}
}
/// 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.
/// true if the local variables in this method should be zero initialized; otherwise false.
/// For the current method, the property is true, but the property is false. (Get or set.)
// 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;
}
}
/// Retrieves the internal handle for the method. Use this handle to access the underlying metadata handle.
/// Read-only. The internal handle for the method. Use this handle to access the underlying metadata handle.
/// This method is not currently supported. Retrieve the method using and call on the returned .
// Token: 0x170004CC RID: 1228
// (get) Token: 0x06001B01 RID: 6913 RVA: 0x00065868 File Offset: 0x00063A68
public override RuntimeMethodHandle MethodHandle
{
get
{
throw this.NotSupported();
}
}
/// Gets the return type of the method represented by this .
/// The return type of the method.
// Token: 0x170004CD RID: 1229
// (get) Token: 0x06001B02 RID: 6914 RVA: 0x00065870 File Offset: 0x00063A70
public override Type ReturnType
{
get
{
return this.rtype;
}
}
/// Retrieves the class that was used in reflection to obtain this object.
/// Read-only. The type used to obtain this method.
// Token: 0x170004CE RID: 1230
// (get) Token: 0x06001B03 RID: 6915 RVA: 0x00065878 File Offset: 0x00063A78
public override Type ReflectedType
{
get
{
return this.type;
}
}
/// Returns the type that declares this method.
/// Read-only. The type that declares this method.
// Token: 0x170004CF RID: 1231
// (get) Token: 0x06001B04 RID: 6916 RVA: 0x00065880 File Offset: 0x00063A80
public override Type DeclaringType
{
get
{
return this.type;
}
}
/// Retrieves the name of this method.
/// Read-only. Retrieves a string containing the simple name of this method.
// Token: 0x170004D0 RID: 1232
// (get) Token: 0x06001B05 RID: 6917 RVA: 0x00065888 File Offset: 0x00063A88
public override string Name
{
get
{
return this.name;
}
}
/// Retrieves the attributes for this method.
/// Read-only. Retrieves the MethodAttributes for this method.
// Token: 0x170004D1 RID: 1233
// (get) Token: 0x06001B06 RID: 6918 RVA: 0x00065890 File Offset: 0x00063A90
public override MethodAttributes Attributes
{
get
{
return this.attrs;
}
}
/// Returns the custom attributes of the method's return type.
/// Read-only. The custom attributes of the method's return type.
// Token: 0x170004D2 RID: 1234
// (get) Token: 0x06001B07 RID: 6919 RVA: 0x00065898 File Offset: 0x00063A98
public override ICustomAttributeProvider ReturnTypeCustomAttributes
{
get
{
return null;
}
}
/// Returns the calling convention of the method.
/// Read-only. The calling convention of the method.
// Token: 0x170004D3 RID: 1235
// (get) Token: 0x06001B08 RID: 6920 RVA: 0x0006589C File Offset: 0x00063A9C
public override CallingConventions CallingConvention
{
get
{
return this.call_conv;
}
}
/// Retrieves the signature of the method.
/// Read-only. A String containing the signature of the method reflected by this MethodBase instance.
// 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));
}
}
/// Returns the MethodToken that represents the token for this method.
/// Returns the MethodToken of this method.
// Token: 0x06001B0E RID: 6926 RVA: 0x00065964 File Offset: 0x00063B64
public MethodToken GetToken()
{
return new MethodToken(100663296 | this.table_idx);
}
/// Return the base implementation for a method.
/// The base implementation of this method.
// Token: 0x06001B0F RID: 6927 RVA: 0x00065978 File Offset: 0x00063B78
public override MethodInfo GetBaseDefinition()
{
return this;
}
/// Returns the implementation flags for the method.
/// Returns the implementation flags for the method.
// Token: 0x06001B10 RID: 6928 RVA: 0x0006597C File Offset: 0x00063B7C
public override MethodImplAttributes GetMethodImplementationFlags()
{
return this.iattrs;
}
/// Returns the parameters of this method.
/// An array of ParameterInfo objects that represent the parameters of the method.
/// This method is not currently supported. Retrieve the method using and call GetParameters on the returned .
// 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;
}
/// Returns a reference to the module that contains this method.
/// Returns a reference to the module that contains this method.
// Token: 0x06001B13 RID: 6931 RVA: 0x00065A24 File Offset: 0x00063C24
public Module GetModule()
{
return this.type.Module;
}
/// Creates the body of the method using a supplied byte array of Microsoft intermediate language (MSIL) instructions.
/// An array containing valid MSIL instructions. If this parameter is null, the method's body is cleared.
/// The number of valid bytes in the MSIL array. This value is ignored if MSIL is null.
/// The is not within the range of indexes of the supplied MSIL instruction array and is not null.
/// The containing type was previously created using .-or- This method was called previously on this MethodBuilder with an argument that was not null.-or-For the current method, the property is true, but the property is false.
// 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);
}
}
/// 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.
/// Returns an object containing the return value of the invoked method.
/// The object on which to invoke the specified method. If the method is static, this parameter is ignored.
/// This must be a bit flag from : InvokeMethod, NonPublic, and so on.
/// 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 .
/// 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.
/// An instance of used to govern the coercion of types. If this is null, the for the current thread is used. (Note that this is necessary to, for example, convert a that represents 1000 to a value, since 1000 is represented differently by different cultures.)
/// This method is not currently supported. Retrieve the method using and call on the returned .
// 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();
}
/// Checks if the specified custom attribute type is defined.
/// true if the specified custom attribute type is defined; otherwise, false.
/// The custom attribute type.
/// Specifies whether to search this member's inheritance chain to find the custom attributes.
/// This method is not currently supported. Retrieve the method using and call on the returned .
// Token: 0x06001B16 RID: 6934 RVA: 0x00065ABC File Offset: 0x00063CBC
public override bool IsDefined(Type attributeType, bool inherit)
{
throw this.NotSupported();
}
/// Returns all the custom attributes defined for this method.
/// Returns an array of objects representing all the custom attributes of this method.
/// Specifies whether to search this member's inheritance chain to find the custom attributes.
/// This method is not currently supported. Retrieve the method using and call on the returned .
// 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();
}
/// Returns the custom attributes identified by the given type.
/// Returns an array of objects representing the attributes of this method that are of type .
/// The custom attribute type.
/// Specifies whether to search this member's inheritance chain to find the custom attributes.
/// This method is not currently supported. Retrieve the method using and call on the returned .
// 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();
}
/// Returns an ILGenerator for this method with a default Microsoft intermediate language (MSIL) stream size of 64 bytes.
/// Returns an ILGenerator object for this method.
/// The method should not have a body because of its or flags, for example because it has the flag. -or-The method is a generic method, but not a generic method definition. That is, the property is true, but the property is false.
// Token: 0x06001B19 RID: 6937 RVA: 0x00065B08 File Offset: 0x00063D08
public ILGenerator GetILGenerator()
{
return this.GetILGenerator(64);
}
/// Returns an ILGenerator for this method with the specified Microsoft intermediate language (MSIL) stream size.
/// Returns an ILGenerator object for this method.
/// The size of the MSIL stream, in bytes.
/// The method should not have a body because of its or flags, for example because it has the flag. -or-The method is a generic method, but not a generic method definition. That is, the property is true, but the property is false.
// 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;
}
/// 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.
/// Returns a ParameterBuilder object that represents a parameter of this method or the return value of this method.
/// 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.
/// The parameter attributes of the parameter.
/// The name of the parameter. The name can be the null string.
/// The method has no parameters.-or- is less than zero.-or- is greater than the number of the method's parameters.
/// The containing type was previously created using .-or-For the current method, the property is true, but the property is false.
// 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();
}
}
/// Sets a custom attribute using a custom attribute builder.
/// An instance of a helper class to describe the custom attribute.
///
/// is null.
/// For the current method, the property is true, but the property is false.
// 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;
}
}
/// Sets a custom attribute using a specified custom attribute blob.
/// The constructor for the custom attribute.
/// A byte blob representing the attributes.
///
/// or is null.
/// For the current method, the property is true, but the property is false.
// 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));
}
/// Sets the implementation flags for this method.
/// The implementation flags to set.
/// The containing type was previously created using .-or-For the current method, the property is true, but the property is false.
// Token: 0x06001B21 RID: 6945 RVA: 0x000660BC File Offset: 0x000642BC
public void SetImplementationFlags(MethodImplAttributes attributes)
{
this.RejectIfCreated();
this.iattrs = attributes;
}
/// Adds declarative security to this method.
/// The security action to be taken (Demand, Assert, and so on).
/// The set of permissions the action applies to.
/// The is invalid (RequestMinimum, RequestOptional, and RequestRefuse are invalid).
/// The containing type has been created using .-or-The permission set contains an action that was added earlier by .-or-For the current method, the property is true, but the property is false.
///
/// is null.
// Token: 0x06001B22 RID: 6946 RVA: 0x000660CC File Offset: 0x000642CC
public void AddDeclarativeSecurity(SecurityAction action, PermissionSet pset)
{
}
/// Sets marshaling information for the return type of this method.
/// Marshaling information for the return type of this method.
/// The containing type was previously created using .-or-For the current method, the property is true, but the property is false.
// 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();
}
/// Set a symbolic custom attribute using a blob.
/// The name of the symbolic custom attribute.
/// The byte blob that represents the value of the symbolic custom attribute.
/// The containing type was previously created using .-or- The module that contains this method is not a debug module. -or-For the current method, the property is true, but the property is false.
// Token: 0x06001B24 RID: 6948 RVA: 0x000660E0 File Offset: 0x000642E0
[MonoTODO]
public void SetSymCustomAttribute(string name, byte[] data)
{
this.RejectIfCreated();
throw new NotImplementedException();
}
/// Returns this MethodBuilder instance as a string.
/// 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.
// Token: 0x06001B25 RID: 6949 RVA: 0x000660F0 File Offset: 0x000642F0
public override string ToString()
{
return string.Concat(new string[]
{
"MethodBuilder [",
this.type.Name,
"::",
this.name,
"]"
});
}
/// Determines whether the given object is equal to this instance.
/// true if is an instance of MethodBuilder and is equal to this object; otherwise, false.
/// The object to compare with this MethodBuilder instance.
// Token: 0x06001B26 RID: 6950 RVA: 0x00066138 File Offset: 0x00064338
[MonoTODO]
public override bool Equals(object obj)
{
return base.Equals(obj);
}
/// Gets the hash code for this method.
/// The hash code for this method.
// 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.");
}
/// Returns a generic method constructed from the current generic method definition using the specified generic type arguments.
/// A representing the generic method constructed from the current generic method definition using the specified generic type arguments.
/// An array of objects that represent the type arguments for the generic method.
// Token: 0x06001B2C RID: 6956
[MethodImpl(MethodImplOptions.InternalCall)]
public override extern MethodInfo MakeGenericMethod(params Type[] typeArguments);
/// Gets a value indicating whether the current object represents the definition of a generic method.
/// true if the current object represents the definition of a generic method; otherwise, false.
// Token: 0x170004D9 RID: 1241
// (get) Token: 0x06001B2D RID: 6957 RVA: 0x0006619C File Offset: 0x0006439C
public override bool IsGenericMethodDefinition
{
get
{
return this.generic_params != null;
}
}
/// Gets a value indicating whether the method is a generic method.
/// true if the method is generic; otherwise, false.
// Token: 0x170004DA RID: 1242
// (get) Token: 0x06001B2E RID: 6958 RVA: 0x000661AC File Offset: 0x000643AC
public override bool IsGenericMethod
{
get
{
return this.generic_params != null;
}
}
/// Returns this method.
/// The current instance of .
/// The current method is not generic. That is, the property returns false.
// Token: 0x06001B2F RID: 6959 RVA: 0x000661BC File Offset: 0x000643BC
public override MethodInfo GetGenericMethodDefinition()
{
if (!this.IsGenericMethodDefinition)
{
throw new InvalidOperationException();
}
return this;
}
/// Returns an array of objects that represent the type parameters of the method, if it is generic.
/// An array of objects representing the type parameters, if the method is generic, or null if the method is not generic.
// 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;
}
/// Sets the number of generic type parameters for the current method, specifies their names, and returns an array of objects that can be used to define their constraints.
/// An array of objects representing the type parameters of the generic method.
/// An array of strings that represent the names of the generic type parameters.
/// Generic type parameters have already been defined for this method.-or-The method has been completed already.-or-The method has been called for the current method.
///
/// is null.-or-An element of is null.
///
/// is an empty array.
// 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;
}
/// Sets the return type of the method.
/// A object that represents the return type of the method.
/// The current method is generic, but is not a generic method definition. That is, the property is true, but the property is false.
// Token: 0x06001B32 RID: 6962 RVA: 0x000662A8 File Offset: 0x000644A8
public void SetReturnType(Type returnType)
{
this.rtype = returnType;
}
/// Sets the number and types of parameters for a method.
/// An array of objects representing the parameter types.
/// The current method is generic, but is not a generic method definition. That is, the property is true, but the property is false.
// 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);
}
}
/// 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.
/// The return type of the method.
/// An array of types representing the required custom modifiers, such as , for the return type of the method. If the return type has no required custom modifiers, specify null.
/// An array of types representing the optional custom modifiers, such as , for the return type of the method. If the return type has no optional custom modifiers, specify null.
/// The types of the parameters of the method.
/// An array of arrays of types. Each array of types represents the required custom modifiers for the corresponding parameter, such as . 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.
/// An array of arrays of types. Each array of types represents the optional custom modifiers for the corresponding parameter, such as . 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.
/// The current method is generic, but is not a generic method definition. That is, the property is true, but the property is false.
// 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;
}
/// Gets the module in which the current method is being defined.
/// The in which the member represented by the current is being defined.
// 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;
}
}