Export (0) Print
Expand All

ModuleBuilder.DefineType Method (String, TypeAttributes, Type)

Defines a type with the specified type name, attributes, and base type in this module.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

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

Parameters

name
Type: System.String
The full name of the type, including the namespace. name cannot contain embedded nulls.
attr
Type: System.Reflection.TypeAttributes
The attribute to be associated with the type.
parent
Type: System.Type
The type that the defined type extends.

Return Value

Type: System.Reflection.Emit.TypeBuilder
A type with the specified characteristics.

ExceptionCondition
ArgumentException

A type with the given name exists in the parent assembly of this module.

-or-

Nested type attributes are set on a type that is not nested.

ArgumentNullException

name is null.

Type names must be unique within an assembly.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft