System.Reflection.Emit.ModuleBuilder.DefineType Method

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

Syntax

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

Parameters

name
The full path of the type. name cannot contain embedded nulls.
attr
The attribute to be associated with the type.
parent
The type that the defined type extends.

Returns

A TypeBuilder created with all of the requested attributes.

Remarks

Type names must be unique within an assembly. You cannot 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