_Type.GetConstructors 方法

定義

為 COM 物件提供與版本無關的 GetConstructors 方法之存取權。

多載

GetConstructors()

為 COM 物件提供與版本無關的 GetConstructors() 方法之存取權。

GetConstructors(BindingFlags)

為 COM 物件提供與版本無關的 GetConstructors(BindingFlags) 方法之存取權。

備註

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

方法 Type.GetConstructors 會取得目前 Type的建構函式。

GetConstructors()

為 COM 物件提供與版本無關的 GetConstructors() 方法之存取權。

public:
 cli::array <System::Reflection::ConstructorInfo ^> ^ GetConstructors();
public System.Reflection.ConstructorInfo[] GetConstructors ();
abstract member GetConstructors : unit -> System.Reflection.ConstructorInfo[]
Public Function GetConstructors () As ConstructorInfo()

傳回

ConstructorInfo 物件組成的陣列,表示定義給目前 Type 的所有公用執行個體建構函式,但不含類型初始設定式 (靜態建構函式)。 如果目前的 Type 沒有定義任何公用執行個體建構函式,或目前的 Type 代表的是泛型型別或方法定義的型別參數,則會傳回 ConstructorInfo 型別的空陣列。

備註

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

方法會 Type.GetConstructors 傳回針對目前 Type定義的所有公用建構函式。

適用於

GetConstructors(BindingFlags)

為 COM 物件提供與版本無關的 GetConstructors(BindingFlags) 方法之存取權。

public:
 cli::array <System::Reflection::ConstructorInfo ^> ^ GetConstructors(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.ConstructorInfo[] GetConstructors (System.Reflection.BindingFlags bindingAttr);
abstract member GetConstructors : System.Reflection.BindingFlags -> System.Reflection.ConstructorInfo[]
Public Function GetConstructors (bindingAttr As BindingFlags) As ConstructorInfo()

參數

bindingAttr
BindingFlags

位元遮罩,由一或多個 BindingFlags 組成,而這些旗標會指定執行搜尋的方式。

-或-

零,傳回 null

傳回

ConstructorInfo 物件的陣列,代表為目前 Type 定義之符合指定繫結條件約束的所有建構函式,包括類型初始設定式 (如果已定義)。 如果目前的 Type 沒有定義建構函式,或所定義的建構函式都不符合繫結條件約束,或目前的 Type 代表的是泛型型別或方法定義的型別參數,則傳回 ConstructorInfo 型別的空陣列。

備註

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

方法會Type.GetConstructors使用指定的 BindingFlags,搜尋針對目前 Type所定義的建構函式。

適用於