Click or drag to resize
ConstructorInfoInvoke Method (Object)
Invokes the constructor reflected by the instance that has the specified parameters, providing default values for the parameters not commonly used.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public Object Invoke(
	Object[] parameters
)

Parameters

parameters
Type: SystemObject
An array of values that matches the number, order and type (under the constraints of the default binder) of the parameters for this constructor. If this constructor takes no parameters, then use either an array with zero elements or null, 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.

Return Value

Type: Object
An instance of the class associated with the constructor.
Exceptions
ExceptionCondition
MemberAccessExceptionThe class is abstract.-or- The constructor is a class initializer.
MethodAccessExceptionThe constructor is private or protected, and the caller lacks MemberAccess.
ArgumentExceptionThe parameters array does not contain values that match the types accepted by this constructor.
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 permission.
See Also