System.Reflection.Emit.EnumBuilder.GetFields Method

Returns the public and non-public fields that are declared by this type.

Syntax

public override System.Reflection.FieldInfo[] GetFields (System.Reflection.BindingFlags bindingAttr)

Parameters

bindingAttr
This must be a bit flag from System.Reflection.BindingFlags, such as InvokeMethod, NonPublic, and so on.

Returns

Returns an array of System.Reflection.FieldInfo objects representing the public and non-public fields declared or inherited by this type. An empty array is returned if there are no fields, as specified.

Remarks

As a workaround, to retrieve the field of a finished type, retrieve the type using Type.GetType or System.Reflection.Assembly.GetType(string) and use reflection on the retrieved type.

The EnumBuilder.GetFields(System.Reflection.BindingFlags) method does not return fields in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which fields are returned, because that order can vary.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0