TypeBuilder
Defines and creates new instances of classes during run time.
Represents that total size for the type is not specified.
Retrieves the packing size of this type.
Retrieves the total size of a type.
Returns the constructor of the specified constructed generic type that corresponds to the specified constructor of the generic type definition.
Returns the field of the specified constructed generic type that corresponds to the specified field of the generic type definition.
Returns the method of the specified constructed generic type that corresponds to the specified method of the generic type definition.
Adds an interface that this type implements.
Gets a TypeInfo object that represents this type.
public ConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes)
Adds a new constructor to the type, with the given attributes and signature.
public ConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers)
Adds a new constructor to the type, with the given attributes, signature, and custom modifiers.
Defines the default constructor. The constructor defined here will simply call the default constructor of the parent.
Adds a new event to the type, with the given name, attributes and event type.
Adds a new field to the type, with the given name, attributes, and field type.
public FieldBuilder DefineField(string fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes)
Adds a new field to the type, with the given name, attributes, field type, and custom modifiers.
Defines the generic type parameters for the current type, specifying their number and their names, and returns an array of GenericTypeParameterBuilder objects that can be used to set their constraints.
Defines initialized data field in the .sdata section of the portable executable (PE) file.
Adds a new method to the type, with the specified name and method attributes.
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, CallingConventions callingConvention)
Adds a new method to the type, with the specified name, method attributes, and calling convention.
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
Adds a new method to the type, with the specified name, method attributes, calling convention, and method signature.
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
Adds a new method to the type, with the specified name, method attributes, calling convention, method signature, and custom modifiers.
public MethodBuilder DefineMethod(string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)
Adds a new method to the type, with the specified name, method attributes, and method signature.
Specifies a given method body that implements a given method declaration, potentially with a different name.
Defines a nested type, given its name.
Defines a nested type, given its name and attributes.
Defines a nested type, given its name, attributes, and the type that it extends.
Defines a nested type, given its name, attributes, the total size of the type, and the type that it extends.
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, PackingSize packSize)
Defines a nested type, given its name, attributes, the type that it extends, and the packing size.
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, PackingSize packSize, int typeSize)
Defines a nested type, given its name, attributes, size, and the type that it extends.
public TypeBuilder DefineNestedType(string name, TypeAttributes attr, Type parent, Type[] interfaces)
Defines a nested type, given its name, attributes, the type that it extends, and the interfaces that it implements.
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
Adds a new property to the type, with the given name, attributes, calling convention, and property signature.
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
Adds a new property to the type, with the given name, calling convention, property signature, and custom modifiers.
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes)
Adds a new property to the type, with the given name and property signature.
public PropertyBuilder DefineProperty(string name, PropertyAttributes attributes, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
Adds a new property to the type, with the given name, property signature, and custom modifiers.
Defines the initializer for this type.
Defines an uninitialized data field in the .sdata section of the portable executable (PE) file.
Returns a value that indicates whether the current dynamic type has been created.
Sets a custom attribute using a specified custom attribute blob.
Set a custom attribute using a custom attribute builder.
Sets the base type of the type currently under construction.