Muokkaa

Jaa


ModuleBuilder Class

Definition

Defines and represents a module in a dynamic assembly.

public ref class ModuleBuilder : System::Reflection::Module
public ref class ModuleBuilder abstract : System::Reflection::Module
public ref class ModuleBuilder : System::Reflection::Module, System::Runtime::InteropServices::_ModuleBuilder
public class ModuleBuilder : System.Reflection.Module
public abstract class ModuleBuilder : System.Reflection.Module
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public class ModuleBuilder : System.Reflection.Module, System.Runtime.InteropServices._ModuleBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ModuleBuilder : System.Reflection.Module, System.Runtime.InteropServices._ModuleBuilder
type ModuleBuilder = class
    inherit Module
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type ModuleBuilder = class
    inherit Module
    interface _ModuleBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ModuleBuilder = class
    inherit Module
    interface _ModuleBuilder
Public Class ModuleBuilder
Inherits Module
Public MustInherit Class ModuleBuilder
Inherits Module
Public Class ModuleBuilder
Inherits Module
Implements _ModuleBuilder
Inheritance
ModuleBuilder
Attributes
Implements

Examples

The following code sample demonstrates the use of ModuleBuilder to create a dynamic module. Note that the ModuleBuilder is created by calling DefineDynamicModule in AssemblyBuilder, rather than through a constructor.

using namespace System;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
public ref class CodeGenerator
{
private:
   AssemblyBuilder^ myAssemblyBuilder;

public:
   CodeGenerator()
   {
      // Get the current application domain for the current thread.
      AppDomain^ myCurrentDomain = AppDomain::CurrentDomain;
      AssemblyName^ myAssemblyName = gcnew AssemblyName;
      myAssemblyName->Name = "TempAssembly";

      // Define a dynamic assembly in the current application domain.
      myAssemblyBuilder = myCurrentDomain->DefineDynamicAssembly( myAssemblyName, AssemblyBuilderAccess::Run );

      // Define a dynamic module in this assembly.
      ModuleBuilder^ myModuleBuilder = myAssemblyBuilder->DefineDynamicModule( "TempModule" );

      // Define a runtime class with specified name and attributes.
      TypeBuilder^ myTypeBuilder = myModuleBuilder->DefineType( "TempClass", TypeAttributes::Public );

      // Add 'Greeting' field to the class, with the specified attribute and type.
      FieldBuilder^ greetingField = myTypeBuilder->DefineField( "Greeting", String::typeid, FieldAttributes::Public );
      array<Type^>^myMethodArgs = {String::typeid};

      // Add 'MyMethod' method to the class, with the specified attribute and signature.
      MethodBuilder^ myMethod = myTypeBuilder->DefineMethod( "MyMethod", MethodAttributes::Public, CallingConventions::Standard, nullptr, myMethodArgs );
      ILGenerator^ methodIL = myMethod->GetILGenerator();
      methodIL->EmitWriteLine( "In the method..." );
      methodIL->Emit( OpCodes::Ldarg_0 );
      methodIL->Emit( OpCodes::Ldarg_1 );
      methodIL->Emit( OpCodes::Stfld, greetingField );
      methodIL->Emit( OpCodes::Ret );
      myTypeBuilder->CreateType();
   }

   property AssemblyBuilder^ MyAssembly 
   {
      AssemblyBuilder^ get()
      {
         return this->myAssemblyBuilder;
      }
   }
};

int main()
{
   CodeGenerator^ myCodeGenerator = gcnew CodeGenerator;

   // Get the assembly builder for 'myCodeGenerator' object.
   AssemblyBuilder^ myAssemblyBuilder = myCodeGenerator->MyAssembly;

   // Get the module builder for the above assembly builder object .
   ModuleBuilder^ myModuleBuilder = myAssemblyBuilder->GetDynamicModule( "TempModule" );
   Console::WriteLine( "The fully qualified name and path to this module is :{0}", myModuleBuilder->FullyQualifiedName );
   Type^ myType = myModuleBuilder->GetType( "TempClass" );
   MethodInfo^ myMethodInfo = myType->GetMethod( "MyMethod" );

   // Get the token used to identify the method within this module.
   MethodToken myMethodToken = myModuleBuilder->GetMethodToken( myMethodInfo );
   Console::WriteLine( "Token used to identify the method of 'myType'"
   " within the module is {0:x}", myMethodToken.Token );
   array<Object^>^args = {"Hello."};
   Object^ myObject = Activator::CreateInstance( myType, nullptr, nullptr );
   myMethodInfo->Invoke( myObject, args );
}
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Security.Permissions;

public class CodeGenerator
{
   AssemblyBuilder myAssemblyBuilder;
   public CodeGenerator()
   {
      // Get the current application domain for the current thread.
      AppDomain myCurrentDomain = AppDomain.CurrentDomain;
      AssemblyName myAssemblyName = new AssemblyName();
      myAssemblyName.Name = "TempAssembly";

      // Define a dynamic assembly in the current application domain.
      myAssemblyBuilder = myCurrentDomain.DefineDynamicAssembly
                     (myAssemblyName, AssemblyBuilderAccess.Run);

      // Define a dynamic module in this assembly.
      ModuleBuilder myModuleBuilder = myAssemblyBuilder.
                                      DefineDynamicModule("TempModule");

      // Define a runtime class with specified name and attributes.
      TypeBuilder myTypeBuilder = myModuleBuilder.DefineType
                                       ("TempClass",TypeAttributes.Public);

      // Add 'Greeting' field to the class, with the specified attribute and type.
      FieldBuilder greetingField = myTypeBuilder.DefineField("Greeting",
                                                            typeof(String), FieldAttributes.Public);
      Type[] myMethodArgs = { typeof(String) };

      // Add 'MyMethod' method to the class, with the specified attribute and signature.
      MethodBuilder myMethod = myTypeBuilder.DefineMethod("MyMethod",
         MethodAttributes.Public, CallingConventions.Standard, null,myMethodArgs);

      ILGenerator methodIL = myMethod.GetILGenerator();
      methodIL.EmitWriteLine("In the method...");
      methodIL.Emit(OpCodes.Ldarg_0);
      methodIL.Emit(OpCodes.Ldarg_1);
      methodIL.Emit(OpCodes.Stfld, greetingField);
      methodIL.Emit(OpCodes.Ret);
      myTypeBuilder.CreateType();
   }
   public AssemblyBuilder MyAssembly
   {
      get
      {
         return this.myAssemblyBuilder;
      }
   }
}
public class TestClass
{
   public static void Main()
   {
      CodeGenerator myCodeGenerator = new CodeGenerator();
      // Get the assembly builder for 'myCodeGenerator' object.
      AssemblyBuilder myAssemblyBuilder = myCodeGenerator.MyAssembly;
      // Get the module builder for the above assembly builder object .
      ModuleBuilder myModuleBuilder = myAssemblyBuilder.
                                                           GetDynamicModule("TempModule");
      Console.WriteLine("The fully qualified name and path to this "
                               + "module is :" +myModuleBuilder.FullyQualifiedName);
      Type myType = myModuleBuilder.GetType("TempClass");
      MethodInfo myMethodInfo =
                                                myType.GetMethod("MyMethod");
       // Get the token used to identify the method within this module.
      MethodToken myMethodToken =
                        myModuleBuilder.GetMethodToken(myMethodInfo);
      Console.WriteLine("Token used to identify the method of 'myType'"
                    + " within the module is {0:x}",myMethodToken.Token);
     object[] args={"Hello."};
     object myObject = Activator.CreateInstance(myType,null,null);
     myMethodInfo.Invoke(myObject,args);
   }
}
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Security.Permissions

Public Class CodeGenerator
   Private myAssemblyBuilder As AssemblyBuilder

   Public Sub New()
      ' Get the current application domain for the current thread.
      Dim myCurrentDomain As AppDomain = AppDomain.CurrentDomain
      Dim myAssemblyName As New AssemblyName()
      myAssemblyName.Name = "TempAssembly"

      ' Define a dynamic assembly in the current application domain.
      myAssemblyBuilder = _
               myCurrentDomain.DefineDynamicAssembly(myAssemblyName, AssemblyBuilderAccess.Run)

      ' Define a dynamic module in this assembly.
      Dim myModuleBuilder As ModuleBuilder = myAssemblyBuilder.DefineDynamicModule("TempModule")

      ' Define a runtime class with specified name and attributes.
      Dim myTypeBuilder As TypeBuilder = _
               myModuleBuilder.DefineType("TempClass", TypeAttributes.Public)

      ' Add 'Greeting' field to the class, with the specified attribute and type.
      Dim greetingField As FieldBuilder = _
               myTypeBuilder.DefineField("Greeting", GetType(String), FieldAttributes.Public)
      Dim myMethodArgs As Type() = {GetType(String)}

      ' Add 'MyMethod' method to the class, with the specified attribute and signature.
      Dim myMethod As MethodBuilder = _
               myTypeBuilder.DefineMethod("MyMethod", MethodAttributes.Public, _
               CallingConventions.Standard, Nothing, myMethodArgs)

      Dim methodIL As ILGenerator = myMethod.GetILGenerator()
      methodIL.EmitWriteLine("In the method...")
      methodIL.Emit(OpCodes.Ldarg_0)
      methodIL.Emit(OpCodes.Ldarg_1)
      methodIL.Emit(OpCodes.Stfld, greetingField)
      methodIL.Emit(OpCodes.Ret)
      myTypeBuilder.CreateType()
   End Sub

   Public ReadOnly Property MyAssembly() As AssemblyBuilder
      Get
         Return Me.myAssemblyBuilder
      End Get
   End Property
End Class

Public Class TestClass
   <PermissionSetAttribute(SecurityAction.Demand, Name:="FullTrust")> _
   Public Shared Sub Main()
      Dim myCodeGenerator As New CodeGenerator()
      ' Get the assembly builder for 'myCodeGenerator' object.
      Dim myAssemblyBuilder As AssemblyBuilder = myCodeGenerator.MyAssembly
      ' Get the module builder for the above assembly builder object .
      Dim myModuleBuilder As ModuleBuilder = myAssemblyBuilder.GetDynamicModule("TempModule")
      Console.WriteLine("The fully qualified name and path to this " + _
                        "module is :" + myModuleBuilder.FullyQualifiedName)
      Dim myType As Type = myModuleBuilder.GetType("TempClass")
      Dim myMethodInfo As MethodInfo = myType.GetMethod("MyMethod")
      ' Get the token used to identify the method within this module.
      Dim myMethodToken As MethodToken = myModuleBuilder.GetMethodToken(myMethodInfo)
      Console.WriteLine("Token used to identify the method of 'myType'" + _
                        " within the module is {0:x}", myMethodToken.Token)
      Dim args As Object() = {"Hello."}
      Dim myObject As Object = Activator.CreateInstance(myType, Nothing, Nothing)
      myMethodInfo.Invoke(myObject, args)
   End Sub
End Class

Remarks

To get an instance of ModuleBuilder, use the AssemblyBuilder.DefineDynamicModule method.

Constructors

ModuleBuilder()

Initializes a new instance of the ModuleBuilder class.

Properties

Assembly

Gets the dynamic assembly that defined this instance of ModuleBuilder.

Assembly

Gets the appropriate Assembly for this instance of Module.

(Inherited from Module)
CustomAttributes

Gets a collection that contains this module's custom attributes.

(Inherited from Module)
FullyQualifiedName

Gets a String representing the fully qualified name and path to this module.

MDStreamVersion

Gets the metadata stream version.

MDStreamVersion

Gets the metadata stream version.

(Inherited from Module)
MetadataToken

Gets a token that identifies the current dynamic module in metadata.

MetadataToken

Gets a token that identifies the module in metadata.

(Inherited from Module)
ModuleHandle

Gets a handle for the module.

(Inherited from Module)
ModuleVersionId

Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module.

ModuleVersionId

Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module.

(Inherited from Module)
Name

A string that indicates that this is an in-memory module.

Name

Gets a String representing the name of the module with the path removed.

(Inherited from Module)
ScopeName

Gets a string that represents the name of the dynamic module.

ScopeName

Gets a string representing the name of the module.

(Inherited from Module)

Methods

CreateGlobalFunctions()

Completes the global function definitions and global data definitions for this dynamic module.

CreateGlobalFunctionsCore()

When overridden in a derived class, completes the global function definitions and global data definitions for this dynamic module.

DefineDocument(String, Guid, Guid, Guid)

Defines a document for source.

DefineDocument(String, Guid)

Defines a document for source.

DefineDocumentCore(String, Guid)

When override in a derived class, defines a document for source.

DefineEnum(String, TypeAttributes, Type)

Defines an enumeration type that is a value type with a single non-static field called value__ of the specified type.

DefineEnumCore(String, TypeAttributes, Type)

When overridden in a derived class, defines an enumeration type that is a value type with a single non-static field called value__ of the specified type.

DefineGlobalMethod(String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

Defines a global method with the specified name, attributes, calling convention, return type, custom modifiers for the return type, parameter types, and custom modifiers for the parameter types.

DefineGlobalMethod(String, MethodAttributes, CallingConventions, Type, Type[])

Defines a global method with the specified name, attributes, calling convention, return type, and parameter types.

DefineGlobalMethod(String, MethodAttributes, Type, Type[])

Defines a global method with the specified name, attributes, return type, and parameter types.

DefineGlobalMethodCore(String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

When overridden in a derived class, defines a global method with the specified name, attributes, calling convention, return type, custom modifiers for the return type, parameter types, and custom modifiers for the parameter types.

DefineInitializedData(String, Byte[], FieldAttributes)

Defines an initialized data field in the .sdata section of the portable executable (PE) file.

DefineInitializedDataCore(String, Byte[], FieldAttributes)

When overridden in a derived class, defines an initialized data field in the .sdata section of the portable executable (PE) file.

DefineManifestResource(String, Stream, ResourceAttributes)

Defines a binary large object (BLOB) that represents a manifest resource to be embedded in the dynamic assembly.

DefinePInvokeMethod(String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

Defines a PInvoke method with the specified 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.

DefinePInvokeMethod(String, String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

Defines a PInvoke method with the specified 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.

DefinePInvokeMethodCore(String, String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

When overridden in a derived class, defines a PInvoke method.

DefineResource(String, String, ResourceAttributes)

Defines the named managed embedded resource with the given attributes that is to be stored in this module.

DefineResource(String, String)

Defines the named managed embedded resource to be stored in this module.

DefineType(String, TypeAttributes, Type, Int32)

Constructs a TypeBuilder given the type name, the attributes, the type that the defined type extends, and the total size of the type.

DefineType(String, TypeAttributes, Type, PackingSize, Int32)

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.

DefineType(String, TypeAttributes, Type, PackingSize)

Constructs a TypeBuilder given the type name, the attributes, the type that the defined type extends, and the packing size of the type.

DefineType(String, TypeAttributes, Type, Type[])

Constructs a TypeBuilder given the type name, attributes, the type that the defined type extends, and the interfaces that the defined type implements.

DefineType(String, TypeAttributes, Type)

Constructs a TypeBuilder given type name, its attributes, and the type that the defined type extends.

DefineType(String, TypeAttributes)

Constructs a TypeBuilder given the type name and the type attributes.

DefineType(String)

Constructs a TypeBuilder for a private type with the specified name in this module.

DefineTypeCore(String, TypeAttributes, Type, Type[], PackingSize, Int32)

When overridden in a derived class, constructs a TypeBuilder.

DefineUninitializedData(String, Int32, FieldAttributes)

Defines an uninitialized data field in the .sdata section of the portable executable (PE) file.

DefineUninitializedDataCore(String, Int32, FieldAttributes)

When overridden in a derived class, defines an uninitialized data field in the .sdata section of the portable executable (PE) file.

DefineUnmanagedResource(Byte[])

Defines an unmanaged embedded resource given an opaque binary large object (BLOB) of bytes.

DefineUnmanagedResource(String)

Defines an unmanaged resource given the name of Win32 resource file.

Equals(Object)

Returns a value that indicates whether this instance is equal to the specified object.

Equals(Object)

Determines whether this module and the specified object are equal.

(Inherited from Module)
FindTypes(TypeFilter, Object)

Returns an array of classes accepted by the given filter and filter criteria.

(Inherited from Module)
GetArrayMethod(Type, String, CallingConventions, Type, Type[])

Returns the named method on an array class.

GetArrayMethodCore(Type, String, CallingConventions, Type, Type[])

When overridden in a derived class, returns the named method on an array class.

GetArrayMethodToken(Type, String, CallingConventions, Type, Type[])

Returns the token for the named method on an array class.

GetConstructorToken(ConstructorInfo, IEnumerable<Type>)

Returns the token used to identify the constructor that has the specified attributes and parameter types within this module.

GetConstructorToken(ConstructorInfo)

Returns the token used to identify the specified constructor within this module.

GetCustomAttributes(Boolean)

Returns all the custom attributes that have been applied to the current ModuleBuilder.

GetCustomAttributes(Boolean)

Returns all custom attributes.

(Inherited from Module)
GetCustomAttributes(Type, Boolean)

Returns all the custom attributes that have been applied to the current ModuleBuilder, and that derive from a specified attribute type.

GetCustomAttributes(Type, Boolean)

Gets custom attributes of the specified type.

(Inherited from Module)
GetCustomAttributesData()

Returns information about the attributes that have been applied to the current ModuleBuilder, expressed as CustomAttributeData objects.

GetCustomAttributesData()

Returns a list of CustomAttributeData objects for the current module, which can be used in the reflection-only context.

(Inherited from Module)
GetField(String, BindingFlags)

Returns a module-level field, defined in the .sdata region of the portable executable (PE) file, that has the specified name and binding attributes.

GetField(String, BindingFlags)

Returns a field having the specified name and binding attributes.

(Inherited from Module)
GetField(String)

Returns a field having the specified name.

(Inherited from Module)
GetFieldMetadataToken(FieldInfo)

When overridden in a derived class, returns the metadata token for the given FieldInfo relative to the Module.

GetFields()

Returns the global fields defined on the module.

(Inherited from Module)
GetFields(BindingFlags)

Returns all fields defined in the .sdata region of the portable executable (PE) file that match the specified binding flags.

GetFields(BindingFlags)

Returns the global fields defined on the module that match the specified binding flags.

(Inherited from Module)
GetFieldToken(FieldInfo)

Returns the token used to identify the specified field within this module.

GetHashCode()

Returns the hash code for this instance.

GetHashCode()

Returns the hash code for this instance.

(Inherited from Module)
GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.

(Inherited from Module)
GetMethod(String, Type[])

Returns a method having the specified name and parameter types.

(Inherited from Module)
GetMethod(String)

Returns a method having the specified name.

(Inherited from Module)
GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns the module-level method that matches the specified criteria.

GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Returns the method implementation in accordance with the specified criteria.

(Inherited from Module)
GetMethodMetadataToken(ConstructorInfo)

When overridden in a derived class, returns the metadata token for the given ConstructorInfo relative to the Module.

GetMethodMetadataToken(MethodInfo)

When overridden in a derived class, returns the metadata token for the given MethodInfo relative to the Module.

GetMethods()

Returns the global methods defined on the module.

(Inherited from Module)
GetMethods(BindingFlags)

Returns all the methods that have been defined at the module level for the current ModuleBuilder, and that match the specified binding flags.

GetMethods(BindingFlags)

Returns the global methods defined on the module that match the specified binding flags.

(Inherited from Module)
GetMethodToken(MethodInfo, IEnumerable<Type>)

Returns the token used to identify the method that has the specified attributes and parameter types within this module.

GetMethodToken(MethodInfo)

Returns the token used to identify the specified method within this module.

GetObjectData(SerializationInfo, StreamingContext)
Obsolete.

Provides an ISerializable implementation for serialized objects.

(Inherited from Module)
GetPEKind(PortableExecutableKinds, ImageFileMachine)

Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module.

GetPEKind(PortableExecutableKinds, ImageFileMachine)

Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module.

(Inherited from Module)
GetSignatureMetadataToken(SignatureHelper)

When overridden in a derived class, returns the metadata token for the given SignatureHelper relative to the Module.

GetSignatureToken(Byte[], Int32)

Defines a token for the signature that has the specified character array and signature length.

GetSignatureToken(SignatureHelper)

Defines a token for the signature that is defined by the specified SignatureHelper.

GetSignerCertificate()

Returns an X509Certificate object corresponding to the certificate included in the Authenticode signature of the assembly which this module belongs to. If the assembly has not been Authenticode signed, null is returned.

GetSignerCertificate()

Returns an X509Certificate object corresponding to the certificate included in the Authenticode signature of the assembly which this module belongs to. If the assembly has not been Authenticode signed, null is returned.

(Inherited from Module)
GetStringConstant(String)

Returns the token of the given string in the module's constant pool.

GetStringMetadataToken(String)

When overridden in a derived class, returns the metadata token for the given String constant relative to the Module.

GetSymWriter()

Returns the symbol writer associated with this dynamic module.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetType(String, Boolean, Boolean)

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.

GetType(String, Boolean, Boolean)

Returns the specified type, specifying whether to make a case-sensitive search of the module and whether to throw an exception if the type cannot be found.

(Inherited from Module)
GetType(String, Boolean)

Gets the named type defined in the module, optionally ignoring the case of the type name.

GetType(String, Boolean)

Returns the specified type, searching the module with the specified case sensitivity.

(Inherited from Module)
GetType(String)

Gets the named type defined in the module.

GetType(String)

Returns the specified type, performing a case-sensitive search.

(Inherited from Module)
GetTypeMetadataToken(Type)

When overridden in a derived class, returns the metadata token for the given Type relative to the Module.

GetTypes()

Returns all the classes defined within this module.

GetTypes()

Returns all the types defined within this module.

(Inherited from Module)
GetTypeToken(String)

Returns the token used to identify the type with the specified name.

GetTypeToken(Type)

Returns the token used to identify the specified type within this module.

IsDefined(Type, Boolean)

Returns a value that indicates whether the specified attribute type has been applied to this module.

IsDefined(Type, Boolean)

Returns a value that indicates whether the specified attribute type has been applied to this module.

(Inherited from Module)
IsResource()

Gets a value indicating whether the object is a resource.

IsResource()

Gets a value indicating whether the object is a resource.

(Inherited from Module)
IsTransient()

Returns a value that indicates whether this dynamic module is transient.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ResolveField(Int32, Type[], Type[])

Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.

ResolveField(Int32, Type[], Type[])

Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters.

(Inherited from Module)
ResolveField(Int32)

Returns the field identified by the specified metadata token.

(Inherited from Module)
ResolveMember(Int32, Type[], Type[])

Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.

ResolveMember(Int32, Type[], Type[])

Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters.

(Inherited from Module)
ResolveMember(Int32)

Returns the type or member identified by the specified metadata token.

(Inherited from Module)
ResolveMethod(Int32, Type[], Type[])

Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters.

ResolveMethod(Int32, Type[], Type[])

Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters.

(Inherited from Module)
ResolveMethod(Int32)

Returns the method or constructor identified by the specified metadata token.

(Inherited from Module)
ResolveSignature(Int32)

Returns the signature blob identified by a metadata token.

ResolveSignature(Int32)

Returns the signature blob identified by a metadata token.

(Inherited from Module)
ResolveString(Int32)

Returns the string identified by the specified metadata token.

ResolveString(Int32)

Returns the string identified by the specified metadata token.

(Inherited from Module)
ResolveType(Int32, Type[], Type[])

Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.

ResolveType(Int32, Type[], Type[])

Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters.

(Inherited from Module)
ResolveType(Int32)

Returns the type identified by the specified metadata token.

(Inherited from Module)
SetCustomAttribute(ConstructorInfo, Byte[])

Applies a custom attribute to this module by using a specified binary large object (BLOB) that represents the attribute.

SetCustomAttribute(CustomAttributeBuilder)

Applies a custom attribute to this module by using a custom attribute builder.

SetCustomAttributeCore(ConstructorInfo, ReadOnlySpan<Byte>)

When overridden in a derived class, sets a custom attribute on this assembly.

SetSymCustomAttribute(String, Byte[])

This method does nothing.

SetUserEntryPoint(MethodInfo)

Sets the user entry point.

ToString()

Returns the name of the module.

(Inherited from Module)

Explicit Interface Implementations

_Module.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Module)
_Module.GetTypeInfo(UInt32, UInt32, IntPtr)

Retrieves the type information for an object, which can then be used to get the type information for an interface.

(Inherited from Module)
_Module.GetTypeInfoCount(UInt32)

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Module)
_Module.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Provides access to properties and methods exposed by an object.

(Inherited from Module)
_ModuleBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

For a description of this member, see GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr).

_ModuleBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

For a description of this member, see GetTypeInfo(UInt32, UInt32, IntPtr).

_ModuleBuilder.GetTypeInfoCount(UInt32)

For a description of this member, see GetTypeInfoCount(UInt32).

_ModuleBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

For a description of this member, see Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr).

ICustomAttributeProvider.GetCustomAttributes(Boolean)

Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes.

(Inherited from Module)
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean)

Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type.

(Inherited from Module)
ICustomAttributeProvider.IsDefined(Type, Boolean)

Indicates whether one or more instance of attributeType is defined on this member.

(Inherited from Module)

Extension Methods

GetCustomAttribute(Module, Type)

Retrieves a custom attribute of a specified type that is applied to a specified module.

GetCustomAttribute<T>(Module)

Retrieves a custom attribute of a specified type that is applied to a specified module.

GetCustomAttributes(Module, Type)

Retrieves a collection of custom attributes of a specified type that are applied to a specified module.

GetCustomAttributes(Module)

Retrieves a collection of custom attributes that are applied to a specified module.

GetCustomAttributes<T>(Module)

Retrieves a collection of custom attributes of a specified type that are applied to a specified module.

IsDefined(Module, Type)

Indicates whether custom attributes of a specified type are applied to a specified module.

GetModuleVersionId(Module)
HasModuleVersionId(Module)

Applies to