HHelpersSetFieldValueWithReflection Method (FieldInfo, Object, Object) |
Writes 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 void SetFieldValueWithReflection(
FieldInfo field,
Object sourceObject,
Object newFieldValue
)
Public Shared Sub SetFieldValueWithReflection (
field As FieldInfo,
sourceObject As Object,
newFieldValue As Object
)
Parameters
- field
- Type: System.ReflectionFieldInfo
The FieldInfo associated with the field to write to. - sourceObject
- Type: SystemObject
The object that contains the field to write to. - newFieldValue
- Type: SystemObject
The new value which will be assigned to the field.
See Also