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 TrySetProperty(
Type type,
string propertyName,
bool ignoreCase,
Object? value,
ReflectionWays way = ReflectionWays.Auto
)
Public Shared Function TrySetProperty (
type As Type,
propertyName As String,
ignoreCase As Boolean,
value As Object,
Optional way As ReflectionWays = ReflectionWays.Auto
) As Boolean
public:
static bool TrySetProperty(
Type^ type,
String^ propertyName,
bool ignoreCase,
Object^ value,
ReflectionWays way = ReflectionWays::Auto
)
static member TrySetProperty :
type : Type *
propertyName : string *
ignoreCase : bool *
value : Object *
?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 SetProperty(Object, PropertyInfo, Object, ReflectionWays, Object) method for better performance.
If way is Auto, then this method uses the DynamicDelegate reflection way.