NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ConstructorInfo.Invoke (BindingFlags, Binder, Object[], CultureInfo)

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;

Parameters

invokeAttr
This value is a field of BindingFlags that specifies the type of binding that is desired (e.g., BindingFlags.CreateInstance, BindingFlags.ExactBinding).
binder
[To be supplied.]
parameters
[To be supplied.]
culture
[To be supplied.]

Exceptions

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.

Remarks

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

See Also

ConstructorInfo Class | ConstructorInfo Members | System.Reflection Namespace | ConstructorInfo.Invoke Overload List | Binder | BindingFlags