NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ModuleBuilder.DefineEnum

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;

Parameters

name
The full path name of the enumeration type.
visibility
[To be supplied.]
underlyingType
[To be supplied.]

Return Value

Returns the defined enumeration.

Exceptions

Exception Type Condition
ArgumentException if attributes other than visibility attributes are provided
ArgumentNullException if name is a null reference (in Visual Basic Nothing)

Remarks

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.

Requirements

NGWS Runtime Security:

ReflectionPermission SecurityAction.Demand, ReflectionEmit

See Also

ModuleBuilder Class | ModuleBuilder Members | System.Reflection.Emit Namespace