public static Object CreateInstance(
Type type,
ReflectionWays way = ReflectionWays.Auto
)
Public Shared Function CreateInstance (
type As Type,
Optional way As ReflectionWays = ReflectionWays.Auto
) As Object
public:
static Object^ CreateInstance(
Type^ type,
ReflectionWays way = ReflectionWays::Auto
)
static member CreateInstance :
type : Type *
?way : ReflectionWays
(* Defaults:
let _way = defaultArg way ReflectionWays.Auto
*)
-> Object
If you are not sure whether the type can be created without constructor parameters, then you can use the TryCreateInstance methods instead.
If way is Auto, then this method uses the DynamicDelegate way.