public static Object? GetField(
Object instance,
string fieldName,
bool ignoreCase,
ReflectionWays way = ReflectionWays.Auto
)
Public Shared Function GetField (
instance As Object,
fieldName As String,
ignoreCase As Boolean,
Optional way As ReflectionWays = ReflectionWays.Auto
) As Object
public:
static Object^ GetField(
Object^ instance,
String^ fieldName,
bool ignoreCase,
ReflectionWays way = ReflectionWays::Auto
)
static member GetField :
instance : Object *
fieldName : string *
ignoreCase : bool *
?way : ReflectionWays
(* Defaults:
let _way = defaultArg way ReflectionWays.Auto
*)
-> Object
fieldName can refer public and non-public fields.
If you already have a FieldInfo instance use the GetField(Object, FieldInfo, ReflectionWays) method for better performance.
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.