Share via


_ConstructorInfo.Invoke_2 方法

定義

為 COM 物件提供與版本無關的 Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) 方法之存取權。

public:
 System::Object ^ Invoke_2(System::Object ^ obj, System::Reflection::BindingFlags invokeAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ parameters, System::Globalization::CultureInfo ^ culture);
public object Invoke_2 (object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] parameters, System.Globalization.CultureInfo culture);
abstract member Invoke_2 : obj * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> obj
Public Function Invoke_2 (obj As Object, invokeAttr As BindingFlags, binder As Binder, parameters As Object(), culture As CultureInfo) As Object

參數

obj
Object

執行個體,建立這個方法。

invokeAttr
BindingFlags

其中一個 BindingFlags 值,指定繫結的型別。

binder
Binder

Binder,會使用反映定義一組屬性和啟用繫結、引數類型強制型轉和成員引動過程。 如果 bindernull,則會使用 Binder.DefaultBinding

parameters
Object[]

Object 型別的陣列,用於比對在 binder 的限制下,這個建構函式的數字、順序和參數的型別。 如果這個建構函式不使用參數,則會使用零元素的陣列或 ,如同在 Object[] parameters = new Object[0] 一樣。 此陣列中任何未明確使用值初始化的物件,都會包含該物件類型的預設值。 對於參考型別項目,這個值為 null。 對於實值型別項目,這個值為 0、0.0 或 false,由特定的項目類型決定。

culture
CultureInfo

CultureInfo,用來管理類型的強制型轉。 如果這是 null,會使用目前執行緒的 CultureInfo

傳回

與建構函式相關聯的類別之執行個體。

備註

此方法適用於從 Unmanaged 程式代碼存取 Managed 類別,不應從 Managed 程式代碼呼叫。

方法會在 Invoke 指定的 條件約束下,使用指定的自變數叫用這個 ConstructorInfo 所反映的 Binder建構函式。

適用於