_Type.GetProperty 方法

定義

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

多載

GetProperty(String, Type, Type[], ParameterModifier[])

為 COM 物件提供與版本無關的 GetProperty(String, Type, Type[], ParameterModifier[]) 方法之存取權。

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

為 COM 物件提供與版本無關的 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) 方法之存取權。

GetProperty(String, Type, Type[])

為 COM 物件提供與版本無關的 GetProperty(String, Type, Type[]) 方法之存取權。

GetProperty(String, Type)

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

GetProperty(String, Type[])

為 COM 物件提供與版本無關的 GetProperty(String, Type[]) 方法之存取權。

GetProperty(String, BindingFlags)

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

GetProperty(String)

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

備註

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

方法 Type.GetProperty 會取得目前 Type的特定屬性。

GetProperty(String, Type, Type[], ParameterModifier[])

為 COM 物件提供與版本無關的 GetProperty(String, Type, Type[], ParameterModifier[]) 方法之存取權。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo

參數

name
String

String,包含要取得的公用屬性名稱。

returnType
Type

屬性的傳回類型。

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。

-或-

用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。

modifiers
ParameterModifier[]

ParameterModifier 物件的陣列,代表在 types 陣列中與對應項目關聯的屬性。 預設的繫結器不會處理這個參數。

傳回

PropertyInfo 物件,表示符合指定之需求的公用屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 搜尋指定的公用屬性,其參數符合指定的自變數類型和修飾詞。

適用於

GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

為 COM 物件提供與版本無關的 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) 方法之存取權。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetProperty : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, bindingAttr As BindingFlags, binder As Binder, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo

參數

name
String

String,包含要取得的屬性名稱。

bindingAttr
BindingFlags

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

-或-

零,傳回 null

binder
Binder

Binder 物件,定義一組屬性並啟用繫結,可包含多載方法的選擇、引數類型的強制型轉,以及透過反映的成員引動過程。

-或-

null,則使用 DefaultBinder

returnType
Type

屬性的傳回類型。

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。

-或-

用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。

modifiers
ParameterModifier[]

ParameterModifier 物件的陣列,代表在 types 陣列中與對應項目關聯的屬性。 預設的繫結器不會處理這個參數。

傳回

PropertyInfo 物件,表示符合指定之需求的屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 使用指定的系結條件約束來搜尋指定的屬性,其參數符合指定的自變數類型和修飾詞。

適用於

GetProperty(String, Type, Type[])

為 COM 物件提供與版本無關的 GetProperty(String, Type, Type[]) 方法之存取權。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType, Type[] types);
abstract member GetProperty : string * Type * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type, types As Type()) As PropertyInfo

參數

name
String

String,包含要取得的公用屬性名稱。

returnType
Type

屬性的傳回類型。

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。

-或-

用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。

傳回

PropertyInfo 物件,表示其參數符合指定之引數類型的公用屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 搜尋指定的公用屬性,其參數符合指定的自變數類型。

適用於

GetProperty(String, Type)

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, Type ^ returnType);
public System.Reflection.PropertyInfo GetProperty (string name, Type returnType);
abstract member GetProperty : string * Type -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, returnType As Type) As PropertyInfo

參數

name
String

String,包含要取得的公用屬性名稱。

returnType
Type

屬性的傳回類型。

傳回

PropertyInfo 物件,表示具有指定之名稱的公用屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 搜尋具有指定名稱和傳回型別的公用屬性。

適用於

GetProperty(String, Type[])

為 COM 物件提供與版本無關的 GetProperty(String, Type[]) 方法之存取權。

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, cli::array <Type ^> ^ types);
public System.Reflection.PropertyInfo GetProperty (string name, Type[] types);
abstract member GetProperty : string * Type[] -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, types As Type()) As PropertyInfo

參數

name
String

String,包含要取得的公用屬性名稱。

types
Type[]

Type 物件的陣列,代表所要取得之索引屬性的參數數目、順序和類型。

-或-

用以取得未編製索引的屬性之 Type 類型的空陣列 (也就是,Type[] types = new Type[0])。

傳回

PropertyInfo 物件,表示其參數符合指定之引數類型的公用屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 搜尋指定的公用屬性,其參數符合指定的自變數類型。

適用於

GetProperty(String, BindingFlags)

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.PropertyInfo GetProperty (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetProperty : string * System.Reflection.BindingFlags -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String, bindingAttr As BindingFlags) As PropertyInfo

參數

name
String

String,包含要取得的屬性名稱。

bindingAttr
BindingFlags

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

-或-

零,傳回 null

傳回

PropertyInfo 物件,表示符合指定之需求的屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 使用指定的系結條件約束來搜尋指定的屬性。

適用於

GetProperty(String)

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

public:
 System::Reflection::PropertyInfo ^ GetProperty(System::String ^ name);
public System.Reflection.PropertyInfo GetProperty (string name);
abstract member GetProperty : string -> System.Reflection.PropertyInfo
Public Function GetProperty (name As String) As PropertyInfo

參數

name
String

String,包含要取得的公用屬性名稱。

傳回

PropertyInfo 物件,表示具有指定之名稱的公用屬性 (如有找到);否則為 null

備註

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

方法會 Type.GetProperty 搜尋具有指定名稱的公用屬性。

適用於