Click or drag to resize
ConstructorInfoInvoke Method (BindingFlags, Binder, Object, CultureInfo)
When implemented in a derived class, invokes the constructor reflected by this ConstructorInfo with the specified arguments, under the constraints of the specified Binder.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public abstract Object Invoke(
	BindingFlags invokeAttr,
	Binder binder,
	Object[] parameters,
	CultureInfo culture
)

Parameters

invokeAttr
Type: System.ReflectionBindingFlags
One of the BindingFlags values that specifies the type of binding.
binder
Type: System.ReflectionBinder
A Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then Binder.DefaultBinding is used.
parameters
Type: SystemObject
An array of type Object used to match the number, order and type of the parameters for this constructor, under the constraints of binder. If this constructor does not require parameters, pass an array with zero elements, as in Object[] parameters = new Object[0]. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type.
culture
Type: System.GlobalizationCultureInfo
A CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used.

Return Value

Type: Object
An instance of the class associated with the constructor.
Exceptions
ExceptionCondition
ArgumentExceptionThe parameters array does not contain values that match the types accepted by this constructor, under the constraints of the binder.
TargetInvocationExceptionThe invoked constructor throws an exception.
TargetParameterCountExceptionAn incorrect number of parameters was passed.
NotSupportedExceptionCreation of TypedReference, ArgIterator, and RuntimeArgumentHandle types is not supported.
SecurityExceptionThe caller does not have the necessary code access permissions.
MemberAccessExceptionThe class is abstract.-or- The constructor is a class initializer.
MethodAccessExceptionThe constructor is private or protected, and the caller lacks MemberAccess.
See Also