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,
out Object result,
params Object?[]? parameters
)
Public Shared Function TryCreateInstance (
type As Type,
<OutAttribute> ByRef result As Object,
ParamArray parameters As Object()
) As Boolean
public:
static bool TryCreateInstance(
Type^ type,
[OutAttribute] Object^% result,
... array<Object^>^ parameters
)
static member TryCreateInstance :
type : Type *
result : Object byref *
parameters : Object[] -> bool
For creating the instance 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.