Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Defining an Enum with Reflection Emit

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

© 2015 Microsoft