System.Reflection.Emit.ModuleBuilder.DefineType Method

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

Syntax

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

Parameters

name
The full path of the type. name cannot contain embedded nulls.
attr
The attributes of the defined type.
parent
The type that the defined type extends.
typesize
The total size of the type.

Returns

A TypeBuilder object.

Remarks

Type names must be unique within an assembly. It is forbidden to have two types with the same name in two different modules of an assembly.

Note:

Starting with the net_v20sp1_long, this member no longer requires System.Security.Permissions.ReflectionPermission with the System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0