public static bool TryGetField(
Object instance,
string fieldName,
out Object?? value,
ReflectionWays way = ReflectionWays.Auto
)
Public Shared Function TryGetField (
instance As Object,
fieldName As String,
<OutAttribute> ByRef value As Object,
Optional way As ReflectionWays = ReflectionWays.Auto
) As Boolean
public:
static bool TryGetField(
Object^ instance,
String^ fieldName,
[OutAttribute] Object^% value,
ReflectionWays way = ReflectionWays::Auto
)
static member TryGetField :
instance : Object *
fieldName : string *
value : Object byref *
?way : ReflectionWays
(* Defaults:
let _way = defaultArg way ReflectionWays.Auto
*)
-> bool
fieldName can refer public and non-public fields.
If you are not sure whether a field with the specified fieldName exists, then you can use the TryGetField methods instead.
If way is Auto, then this method uses the DynamicDelegate way.