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[]

使绑定能够处理在其中修改了类型的参数签名的参数修饰符数组。

返回

PropertyInfo

匹配的属性。

例外

对于默认联编程序,match 包含多个与 returnTypeindexes 良好匹配且匹配程序相同的属性。

对于默认联编程序,matchnull 或一个空数组。

注解

此方法控制方法Type提供的GetProperty选定内容。

适用于

另请参阅