Defines an enumeration type with that is a value type with a single non-static field called value__ of the specified type.
[Visual Basic] Public Function DefineEnum( _ ByVal name As String, _ ByVal visibility As TypeAttributes, _ ByVal underlyingType As Type _ ) As EnumBuilder [C#] public EnumBuilder DefineEnum( string name, TypeAttributes visibility, Type underlyingType ); [C++] public: EnumBuilder* DefineEnum( String* name, TypeAttributes visibility, Type* underlyingType ); [JScript] public function DefineEnum( name : String, visibility : TypeAttributes, underlyingType : Type ) : EnumBuilder;
Returns the defined enumeration.
Exception Type | Condition |
---|---|
ArgumentException | if attributes other than visibility attributes are provided |
ArgumentNullException | if name is a null reference (in Visual Basic Nothing) |
The ValueType attribute is set by default on the created type. The defined enum is a subclass of Enum. The defined field has Private and SpecialName set.
NGWS Runtime Security:
ReflectionPermission | SecurityAction.Demand, ReflectionEmit |
ModuleBuilder Class | ModuleBuilder Members | System.Reflection.Emit Namespace