ConstructorInfoWrapper.Invoke Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Invoke(BindingFlags, Binder, Object[], CultureInfo) |
Invokes the constructor with the specified parameters. |
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) |
Invokes the constructor with the specified parameters. |
Invoke(BindingFlags, Binder, Object[], CultureInfo)
Invokes the constructor with the specified parameters.
public:
override System::Object ^ Invoke(System::Reflection::BindingFlags invokeAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ parameters, System::Globalization::CultureInfo ^ culture);
public override object Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture);
override this.Invoke : System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> obj
Public Overrides Function Invoke (invokeAttr As BindingFlags, binder As Binder, parameters As Object(), culture As CultureInfo) As Object
Parameters
- invokeAttr
- BindingFlags
A bitmask that is a combination of 0 or more bit flags from BindingFlags. If binder is null, this parameter is assigned the value Default; thus, whatever you pass in is ignored.
- binder
- Binder
An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null
, the default binder is used.
- parameters
- Object[]
An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null.
- culture
- CultureInfo
An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used.
Returns
Returns Object.
Applies to
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
Invokes the constructor with the specified parameters.
public:
override System::Object ^ Invoke(System::Object ^ obj, System::Reflection::BindingFlags invokeAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ parameters, System::Globalization::CultureInfo ^ culture);
public override object Invoke (object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture);
override this.Invoke : obj * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> obj
Public Overrides Function Invoke (obj As Object, invokeAttr As BindingFlags, binder As Binder, parameters As Object(), culture As CultureInfo) As Object
Parameters
- obj
- Object
The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor.
- invokeAttr
- BindingFlags
A bitmask that is a combination of 0 or more bit flags from BindingFlags. If binder is null, this parameter is assigned the value Default; thus, whatever you pass in is ignored.
- binder
- Binder
An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used.
- parameters
- Object[]
An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null
.
- culture
- CultureInfo
An instance of CultureInfo used to govern the coercion of types. If this is null
, the CultureInfo for the current thread is used.
Returns
An Object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. Before calling the method or constructor, Invoke checks to see if the user has access permission and verifies that the parameters are valid.