次の方法で共有


ConstructorBuilder.Invoke Method (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 on the given object, passing along the specified parameters, and under the constraints of the given binder. This method is not supported.

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

Syntax

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

Parameters

  • binder
    Type: System.Reflection.Binder
    An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is nulla null reference (Nothing in Visual Basic), the default binder is used. See Binder.
  • parameters
    Type: array<System.Object[]
    An argument list. This is an array of arguments with 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).
  • culture
    Type: System.Globalization.CultureInfo
    An instance of CultureInfo used to govern the coercion of types. If this is nulla null reference (Nothing in Visual Basic), the CultureInfo for the current thread is used. (For example, this is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures.)

Return Value

Type: System.Object
The return value of the invoked 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.