Note
If a matching property could be found and the invocation itself has thrown an exception, then this method also throws an exception instead of returning .
public static bool TryGetProperty(
Type type,
string propertyName,
bool ignoreCase,
out Object?? value,
ReflectionWays way = ReflectionWays.Auto
)
Public Shared Function TryGetProperty (
type As Type,
propertyName As String,
ignoreCase As Boolean,
<OutAttribute> ByRef value As Object,
Optional way As ReflectionWays = ReflectionWays.Auto
) As Boolean
public:
static bool TryGetProperty(
Type^ type,
String^ propertyName,
bool ignoreCase,
[OutAttribute] Object^% value,
ReflectionWays way = ReflectionWays::Auto
)
static member TryGetProperty :
type : Type *
propertyName : string *
ignoreCase : bool *
value : Object byref *
?way : ReflectionWays
(* Defaults:
let _way = defaultArg way ReflectionWays.Auto
*)
-> bool
propertyName can refer public and non-public properties.
If you already have a PropertyInfo instance use the GetProperty(Object, PropertyInfo, ReflectionWays, Object) method for better performance.
If way is Auto, then this method uses the DynamicDelegate reflection way.