Binder.SelectProperty 方法

定義

根據指定的條件,從一組指定的屬性中選取屬性。

public:
 abstract System::Reflection::PropertyInfo ^ SelectProperty(System::Reflection::BindingFlags bindingAttr, cli::array <System::Reflection::PropertyInfo ^> ^ match, Type ^ returnType, cli::array <Type ^> ^ indexes, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public abstract System.Reflection.PropertyInfo? SelectProperty (System.Reflection.BindingFlags bindingAttr, System.Reflection.PropertyInfo[] match, Type? returnType, Type[]? indexes, System.Reflection.ParameterModifier[]? modifiers);
public abstract System.Reflection.PropertyInfo SelectProperty (System.Reflection.BindingFlags bindingAttr, System.Reflection.PropertyInfo[] match, Type returnType, Type[] indexes, System.Reflection.ParameterModifier[] modifiers);
abstract member SelectProperty : System.Reflection.BindingFlags * System.Reflection.PropertyInfo[] * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Public MustOverride Function SelectProperty (bindingAttr As BindingFlags, match As PropertyInfo(), returnType As Type, indexes As Type(), modifiers As ParameterModifier()) As PropertyInfo

參數

bindingAttr
BindingFlags

BindingFlags 值的位元組合。

match
PropertyInfo[]

可能相符的屬性集合。 例如,當 Binder 使用 InvokeMember 物件時,這個參數就會指定已由反映判定為可能相符的屬性集合,通常是因為這些屬性具有正確的成員名稱。 DefaultBinder 所提供的預設實作會變更此陣列的順序。

returnType
Type

相符屬性必須有的傳回值。

indexes
Type[]

要被搜尋的索引屬性型別。 用於索引屬性,像是類別的索引子。

modifiers
ParameterModifier[]

參數修飾詞的陣列,啟用繫結以使用型別已被修改的參數簽章。

傳回

符合的屬性。

例外狀況

如果是預設繫結器,match 將包含同樣都與 returnTypeindexes 相符的多個屬性。

如果是預設繫結器 (Binder),match 會是 null 或空白陣列。

備註

這個方法會控制 方法在 上 Type 所提供的 GetProperty 選取範圍。

適用於

另請參閱