Defines an enumeration type that is a value type with a single non-static field called value__ of the specified type.
- name
- The full path of the enumeration type. name cannot contain embedded nulls.
- visibility
- The type attributes for the enumeration. The attributes are any bits defined by System.Reflection.TypeAttributes.VisibilityMask.
- underlyingType
- The underlying type for the enumeration. This must be a built-in integer type.
The defined enumeration.
The defined enum is a derived class of Enum. The value__ field has System.Reflection.FieldAttributes.Private and System.Reflection.FieldAttributes.SpecialName attributes set.
For more information about the built-in integer types that can be specified as the underlying types of enumerations, see .NET Framework Class Library Overview.
In the .NET Framework versions 1.0 and 1.1, it is necessary to define enumerations using System.Reflection.Emit.TypeBuilder because System.Reflection.Emit.EnumBuilder emits enumerations whose elements are of type int instead of the enumeration type. In the .NET Framework version 2.0, System.Reflection.Emit.EnumBuilder emits enumerations whose elements have the correct type.
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.