CreateInstanceAccessorCreateInstanceTInstance, T1, T2, T3, T4(T1, T2, T3, T4) Method

Creates a new instance using the associated constructor with four parameters.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public TInstance CreateInstance<TInstance, T1, T2, T3, T4>(
	T1 param1,
	T2 param2,
	T3 param3,
	T4 param4
)

Parameters

param1  T1
The value of the first parameter.
param2  T2
The value of the second parameter.
param3  T3
The value of the third parameter.
param4  T4
The value of the fourth parameter.

Type Parameters

TInstance
The type of the created instance.
T1
The type of the first parameter.
T2
The type of the second parameter.
T3
The type of the third parameter.
T4
The type of the fourth parameter.

Return Value

TInstance
The created instance.

Exceptions

NotSupportedExceptionThis CreateInstanceAccessor represents a constructor with more than four parameters.
ArgumentExceptionThe number or types of the type arguments are invalid.
InvalidOperationExceptionThis CreateInstanceAccessor represents a static constructor, a constructor of an abstract class, or.a constructor of an open generic type.

See Also