This documentation is archived and is not being maintained.

Defining an Enum with Reflection Emit

Enumerations, or enums, are defined in the scope of a dynamic module using the ModuleBuilder.DefineEnum method. DefineEnum returns an EnumBuilder. Nested enumerations are defined using TypeBuilder.DefineNestedEnum.

An enumeration field is defined using the EnumBuilder.DefineLiteral method.

Before the enumeration is used, the EnumBuilder.CreateType method must be called. CreateType completes the creation of the enumeration.

See Also

Using Reflection Emit