System.Reflection.Emit.EnumBuilder.GetField Method

Returns the field specified by the given name.

Syntax

public override System.Reflection.FieldInfo GetField (string name, System.Reflection.BindingFlags bindingAttr)

Parameters

name
The name of the field to get.
bindingAttr
This must be a bit flag from System.Reflection.BindingFlags : InvokeMethod, NonPublic, and so on.

Returns

Returns the System.Reflection.FieldInfo object representing the field declared or inherited by this type with the specified name and public or non-public modifier. If there are no matches, then null is returned.

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.

Requirements

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