Binder.SelectProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
根據指定的條件,從給定屬性集合中選擇一個屬性。
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);
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的屬性。
預設綁定器則是 match 或 null 空陣列。
備註
此方法控制由 方法在 GetProperty 上的 Type選擇。