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)
Syntaxpublic static Object GetFieldValueWithReflection(
FieldInfo field,
Object sourceObject
)
Public Shared Function GetFieldValueWithReflection (
field As FieldInfo,
sourceObject As Object
) As Object
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:
ObjectThe sourceObject's value of the field.
See Also