public static void SetField(
Type type,
string fieldName,
bool ignoreCase,
Object? value,
ReflectionWays way = ReflectionWays.Auto
)
Public Shared Sub SetField (
type As Type,
fieldName As String,
ignoreCase As Boolean,
value As Object,
Optional way As ReflectionWays = ReflectionWays.Auto
)
public:
static void SetField(
Type^ type,
String^ fieldName,
bool ignoreCase,
Object^ value,
ReflectionWays way = ReflectionWays::Auto
)
static member SetField :
type : Type *
fieldName : string *
ignoreCase : bool *
value : Object *
?way : ReflectionWays
(* Defaults:
let _way = defaultArg way ReflectionWays.Auto
*)
-> unit
fieldName can refer public and non-public fields.
If you already have a FieldInfo instance use the SetField(Object, FieldInfo, Object, ReflectionWays) method for better performance.
If you are not sure whether a field with the specified fieldName exists, then you can use the TrySetField methods instead.
If way is Auto, then the DynamicDelegate way will be used.