Click or drag to resize

HHelpersGetFieldValueWithReflection Method (FieldInfo, Object)

Retrieves the value of a field using Reflection. This method may incur considerable performance penalties. This method only operates on fields that are defined by types inside the Terraria, ReLogic, or XNA assemblies. If the type that owns the field is not defined in the Terraria, ReLogic, or XNA assemblies, an exception is thrown.

Namespace:  com.tiberiumfusion.ttplugins.HarmonyPlugins
Assembly:  TTPlugins (in TTPlugins.dll) Version: 1.2.0.1 (1.2.0.1)
Syntax
public static Object GetFieldValueWithReflection(
	FieldInfo field,
	Object sourceObject
)

Parameters

field
Type: System.ReflectionFieldInfo
The FieldInfo associated with the field to be read.
sourceObject
Type: SystemObject
The object that contains the field to be read.

Return Value

Type: Object
The sourceObject's value of the field.
See Also