When implemented by a subclass, this method invokes the constructor reflected by this ConstructorInfo with the specified arguments, under the constraints of the specified Binder.
[Visual Basic] Overloads MustOverride Public Function Invoke( _ ByVal invokeAttr As BindingFlags, _ ByVal binder As Binder, _ ByVal parameters() As Object, _ ByVal culture As CultureInfo _ ) As Object [C#] public abstract object Invoke( BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture ); [C++] public: virtual Object* Invoke( BindingFlags invokeAttr, Binder* binder, Object* parameters[], CultureInfo* culture ) = 0; [JScript] public abstract function Invoke( invokeAttr : BindingFlags, binder : Binder, parameters : Object[], culture : CultureInfo ) : Object;
Exception Type | Condition |
---|---|
AccessException | The attempt to access the constructor fails (e.g., the class may be abstract) or the method is a class initializer.The InnerException property of the TargetInvocationException will hold the exception thrown by the constructor. |
ArgumentException | The parameters array does not contain values that match the number, order and type of the parameters accepted by this constructor, under the constraints of the binder. |
TargetInvocationException | The invoked constructor throws an exception. The InnerException property of the TargetInvocationException will hold the exception thrown by the constructor. |
The number, type, and order of elements in the parameters array should be identical to the number, type, and order of parameters for the constructor reflected by this instance.
Before calling the constructor, Invoke will check to see if the caller has access permission and verify that the parameters are of the correct number, order and type.
Access restrictions are ignored for fully trusted code. That is, private constructors, methods, fields, and properties can be accessed and invoked via Reflection whenever the code is fully trusted
ConstructorInfo Class | ConstructorInfo Members | System.Reflection Namespace | ConstructorInfo.Invoke Overload List | Binder | BindingFlags