Note
If a matching constructor could be found and the constructor itself has thrown an exception, then this method also throws an exception instead of returning .
public static bool TryCreateInstance(
Type type,
ReflectionWays way,
out Object result,
params Object?[]? parameters
)
Public Shared Function TryCreateInstance (
type As Type,
way As ReflectionWays,
<OutAttribute> ByRef result As Object,
ParamArray parameters As Object()
) As Boolean
public:
static bool TryCreateInstance(
Type^ type,
ReflectionWays way,
[OutAttribute] Object^% result,
... array<Object^>^ parameters
)
static member TryCreateInstance :
type : Type *
way : ReflectionWays *
result : Object byref *
parameters : Object[] -> bool
If way is Auto, then this method uses the DynamicDelegate way, unless for value types with empty or parameters, in which case the SystemReflection way is selected, which will use the Activator class.