System.Reflection.Emit.ModuleBuilder.GetFields Method

Returns all fields defined in the .sdata region of the portable executable (PE) file that match the specified binding flags.

Syntax

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

Parameters

bindingFlags
A combination of the BindingFlags bit flags used to control the search.

Returns

An array of fields that match the specified flags; the array is empty if no such fields exist.

Remarks

When you emit dynamic assemblies, fields in the .sdata region of the portable executable (PE) file are defined by using the ModuleBuilder.DefineInitializedData(string, Byte[], System.Reflection.FieldAttributes) or ModuleBuilder.DefineUninitializedData(string, int, System.Reflection.FieldAttributes) methods.

Note:

Module-level fields cannot be retrieved until after the ModuleBuilder.CreateGlobalFunctions method has been called for the module.

Requirements

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