ReflectorCreateInstance(ConstructorInfo, Object) Method

Creates a new instance by a ConstructorInfo specified in the ctor parameter.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static Object CreateInstance(
	ConstructorInfo ctor,
	params Object?[]? parameters
)

Parameters

ctor  ConstructorInfo
The constructor to be invoked.
parameters  Object
The parameters to be used for invoking the constructor.

Return Value

Object
The return value of the method.

Remarks

For creating the instance this method uses the DynamicDelegate reflection way.

  Note

To invoke the constructor explicitly by dynamically created delegates use the CreateInstanceAccessor class.

See Also