System.Reflection.Emit.ModuleBuilder.DefineType Method

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

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public TypeBuilder DefineType (string name, System.Reflection.TypeAttributes attr, Type parent, Type[] interfaces)

Parameters

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

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