<PackageReference Include="System.Reflection.Emit" Version="4.6.0-preview9.19416.11" />

ModuleBuilder

public class ModuleBuilder : Module
Defines and represents a module in a dynamic assembly.
public void CreateGlobalFunctions()

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

public EnumBuilder DefineEnum(string name, TypeAttributes visibility, Type underlyingType)

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

public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)

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

public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)

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.

public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)

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

public FieldBuilder DefineInitializedData(string name, byte[] data, FieldAttributes attributes)

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

public TypeBuilder DefineType(string name)

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

public TypeBuilder DefineType(string name, TypeAttributes attr)

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

public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent)

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

public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, int typesize)

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

public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, PackingSize packsize)

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

public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, PackingSize packingSize, int typesize)

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.

public TypeBuilder DefineType(string name, TypeAttributes attr, Type parent, Type[] interfaces)

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

public FieldBuilder DefineUninitializedData(string name, int size, FieldAttributes attributes)

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

public MethodInfo GetArrayMethod(Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)

Returns the named method on an array class.

public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)

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

public void SetCustomAttribute(CustomAttributeBuilder customBuilder)

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