Files
2026-04-10 22:50:51 +02:00

256 lines
16 KiB
C#

using System;
using System.Globalization;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
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: 0x020006DC RID: 1756
[Token(Token = "0x20006DC")]
[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, 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 <see langword="null" />.</param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or <see langword="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 <see langword="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">
/// <see langword="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 <see langword="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 <see langword="null" />.
/// -or-
/// <paramref name="m" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is a type for which <see cref="P:System.Type.IsByRef" /> returns <see langword="true" />.</exception>
// Token: 0x06003217 RID: 12823 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6003217")]
[Address(RVA = "0x2A060E0", Offset = "0x2A04EE0", VA = "0x182A060E0")]
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Module m, bool 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 <see langword="null" />.</param>
/// <param name="returnType">A <see cref="T:System.Type" /> object that specifies the return type of the dynamic method, or <see langword="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 <see langword="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">
/// <see langword="true" /> to skip JIT visibility checks on types and members accessed by the MSIL of the dynamic method; otherwise, <see langword="false" />.</param>
/// <exception cref="T:System.ArgumentException">An element of <paramref name="parameterTypes" /> is <see langword="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 <see langword="null" />.
/// -or-
/// <paramref name="owner" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="returnType" /> is <see langword="null" />, or is a type for which <see cref="P:System.Type.IsByRef" /> returns <see langword="true" />.</exception>
// Token: 0x06003218 RID: 12824 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6003218")]
[Address(RVA = "0x2A06110", Offset = "0x2A04F10", VA = "0x182A06110")]
public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner, bool skipVisibility)
{
}
/// <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: 0x170007BD RID: 1981
// (get) Token: 0x06003219 RID: 12825 RVA: 0x000199B0 File Offset: 0x00017BB0
[Token(Token = "0x170007BD")]
public override MethodAttributes Attributes
{
[Token(Token = "0x6003219")]
[Address(RVA = "0x2A06140", Offset = "0x2A04F40", VA = "0x182A06140", Slot = "22")]
get
{
return MethodAttributes.PrivateScope;
}
}
/// <summary>Gets the type that declares the method, which is always <see langword="null" /> for dynamic methods.</summary>
/// <returns>Always <see langword="null" />.</returns>
// Token: 0x170007BE RID: 1982
// (get) Token: 0x0600321A RID: 12826 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x170007BE")]
public override Type DeclaringType
{
[Token(Token = "0x600321A")]
[Address(RVA = "0x2A06170", Offset = "0x2A04F70", VA = "0x182A06170", Slot = "9")]
get
{
return null;
}
}
/// <summary>Gets or sets a value indicating whether the local variables in the method are zero-initialized.</summary>
/// <returns>
/// <see langword="true" /> if the local variables in the method are zero-initialized; otherwise, <see langword="false" />. The default is <see langword="true" />.</returns>
// Token: 0x170007BF RID: 1983
// (set) Token: 0x0600321B RID: 12827 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x170007BF")]
public bool InitLocals
{
[Token(Token = "0x600321B")]
[Address(RVA = "0x2A06230", Offset = "0x2A05030", VA = "0x182A06230")]
set
{
}
}
/// <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: 0x170007C0 RID: 1984
// (get) Token: 0x0600321C RID: 12828 RVA: 0x000199C8 File Offset: 0x00017BC8
[Token(Token = "0x170007C0")]
public override RuntimeMethodHandle MethodHandle
{
[Token(Token = "0x600321C")]
[Address(RVA = "0x2A061A0", Offset = "0x2A04FA0", VA = "0x182A061A0", Slot = "21")]
get
{
return default(RuntimeMethodHandle);
}
}
/// <summary>Gets the name of the dynamic method.</summary>
/// <returns>The simple name of the method.</returns>
// Token: 0x170007C1 RID: 1985
// (get) Token: 0x0600321D RID: 12829 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x170007C1")]
public override string Name
{
[Token(Token = "0x600321D")]
[Address(RVA = "0x2A061D0", Offset = "0x2A04FD0", VA = "0x182A061D0", Slot = "8")]
get
{
return null;
}
}
/// <summary>Gets the class that was used in reflection to obtain the method.</summary>
/// <returns>Always <see langword="null" />.</returns>
// Token: 0x170007C2 RID: 1986
// (get) Token: 0x0600321E RID: 12830 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x170007C2")]
public override Type ReflectedType
{
[Token(Token = "0x600321E")]
[Address(RVA = "0x2A06200", Offset = "0x2A05000", VA = "0x182A06200", Slot = "10")]
get
{
return null;
}
}
/// <summary>Returns the base implementation for the method.</summary>
/// <returns>The base implementation of the method.</returns>
// Token: 0x0600321F RID: 12831 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x600321F")]
[Address(RVA = "0x2A05F60", Offset = "0x2A04D60", VA = "0x182A05F60", Slot = "44")]
public override MethodInfo GetBaseDefinition()
{
return null;
}
/// <summary>Returns all the custom attributes defined for the method.</summary>
/// <param name="inherit">
/// <see langword="true" /> to search the method's inheritance chain to find the custom attributes; <see langword="false" /> to check only the current method.</param>
/// <returns>An array of objects representing all the custom attributes of the method.</returns>
// Token: 0x06003220 RID: 12832 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6003220")]
[Address(RVA = "0x2A05FC0", Offset = "0x2A04DC0", VA = "0x182A05FC0", Slot = "12")]
public override object[] GetCustomAttributes(bool inherit)
{
return null;
}
/// <summary>Returns the custom attributes of the specified type that have been applied to the method.</summary>
/// <param name="attributeType">A <see cref="T:System.Type" /> representing the type of custom attribute to return.</param>
/// <param name="inherit">
/// <see langword="true" /> to search the method's inheritance chain to find the custom attributes; <see langword="false" /> to check only the current method.</param>
/// <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>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="attributeType" /> is <see langword="null" />.</exception>
// Token: 0x06003221 RID: 12833 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6003221")]
[Address(RVA = "0x2A05F90", Offset = "0x2A04D90", VA = "0x182A05F90", Slot = "13")]
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return null;
}
/// <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: 0x06003222 RID: 12834 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6003222")]
[Address(RVA = "0x2A05FF0", Offset = "0x2A04DF0", VA = "0x182A05FF0")]
public ILGenerator GetILGenerator()
{
return null;
}
/// <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: 0x06003223 RID: 12835 RVA: 0x000199E0 File Offset: 0x00017BE0
[Token(Token = "0x6003223")]
[Address(RVA = "0x2A06020", Offset = "0x2A04E20", VA = "0x182A06020", Slot = "20")]
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: 0x06003224 RID: 12836 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6003224")]
[Address(RVA = "0x2A06050", Offset = "0x2A04E50", VA = "0x182A06050", Slot = "19")]
public override ParameterInfo[] GetParameters()
{
return null;
}
/// <summary>Invokes the dynamic method using the specified parameters, under the constraints of the specified binder, with the specified culture information.</summary>
/// <param name="obj">This parameter is ignored for dynamic methods, because they are static. Specify <see langword="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 <see langword="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 <see langword="null" />.</param>
/// <param name="culture">An instance of <see cref="T:System.Globalization.CultureInfo" /> used to govern the coercion of types. If this is <see langword="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>
/// <returns>A <see cref="T:System.Object" /> containing the return value of the invoked method.</returns>
/// <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 <see langword="false" />, but the dynamic method accesses members that are not <see langword="public" /> or <see langword="internal" /> (<see langword="Friend" /> in Visual Basic).
/// -or-
/// The dynamic method is anonymously hosted and was constructed with <paramref name="skipVisibility" /> set to <see langword="false" />, but it accesses members that are not <see langword="public" />.
/// -or-
/// The dynamic method contains unverifiable code. See the "Verification" section in Remarks for <see cref="T:System.Reflection.Emit.DynamicMethod" />.</exception>
// Token: 0x06003225 RID: 12837 RVA: 0x00002082 File Offset: 0x00000282
[Token(Token = "0x6003225")]
[Address(RVA = "0x2A06080", Offset = "0x2A04E80", VA = "0x182A06080", Slot = "23")]
public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
{
return null;
}
/// <summary>Indicates whether the specified custom attribute type is defined.</summary>
/// <param name="attributeType">A <see cref="T:System.Type" /> representing the type of custom attribute to search for.</param>
/// <param name="inherit">
/// <see langword="true" /> to search the method's inheritance chain to find the custom attributes; <see langword="false" /> to check only the current method.</param>
/// <returns>
/// <see langword="true" /> if the specified custom attribute type is defined; otherwise, <see langword="false" />.</returns>
// Token: 0x06003226 RID: 12838 RVA: 0x000199F8 File Offset: 0x00017BF8
[Token(Token = "0x6003226")]
[Address(RVA = "0x2A060B0", Offset = "0x2A04EB0", VA = "0x182A060B0", Slot = "14")]
public override bool IsDefined(Type attributeType, bool inherit)
{
return default(bool);
}
}
}