ConstructorBuilder.Invoke Method (Object, BindingFlags, Binder, array<Object[], CultureInfo)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Dynamically invokes the constructor reflected by this instance with the specified arguments, under the constraints of the specified Binder. This method is not supported.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overrides Function Invoke ( _
    obj As Object, _
    invokeAttr As BindingFlags, _
    binder As Binder, _
    parameters As Object(), _
    culture As CultureInfo _
) As Object
public override Object Invoke(
    Object obj,
    BindingFlags invokeAttr,
    Binder binder,
    Object[] parameters,
    CultureInfo culture
)

Parameters

  • obj
    Type: System.Object
    The object that needs to be reinitialized.
  • binder
    Type: System.Reflection.Binder
    An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is nulla null reference (Nothing in Visual Basic), Type.DefaultBinder is used.
  • parameters
    Type: array<System.Object[]
    An argument list. This is an array of arguments that have the same number, order, and type as the parameters of the constructor to be invoked. If there are no parameters, this should be nulla null reference (Nothing in Visual Basic).

Return Value

Type: System.Object
An instance of the class associated with the constructor.

Exceptions

Exception Condition
NotSupportedException

This method is not currently supported.

Remarks

To invoke this constructor, complete its type by calling the TypeBuilder.CreateType method. The CreateType method returns the completed type, and you can use the Type.GetConstructor method to get the ConstructorInfo. Call ConstructorInfo.Invoke to invoke the constructor.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.