Defining an Enum with Reflection Emit
An enumeration field is defined using themethod, as demonstrated by the code example for that method.
Before the enumeration is used, the EnumBuilder.CreateType method must be called. CreateType completes the creation of the enumeration.
In the .NET Framework versions 1.0 and 1.1, it is necessary to define enumerations usingbecause emits enumerations whose elements are of type instead of the enumeration type. In the .NET Framework version 2.0, EnumBuilder emits enumerations whose elements have the correct type.