Click or drag to resize

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)
Syntax
public static void SetFieldValueWithReflection(
	FieldInfo field,
	Object sourceObject,
	Object newFieldValue
)

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