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

要匹配的属性集。 例如,使用对象BinderInvokeMember,此参数指定反射确定为可能匹配的属性集,通常是因为它们具有正确的成员名称。 通过 DefaultBinder 更改此数组的顺序提供的默认实现。

returnType
Type

匹配属性必须具有的返回值。

indexes
Type[]

要搜索的属性的索引类型。 用于索引属性,例如类的索引器。

modifiers
ParameterModifier[]

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

返回

匹配属性。

例外

对于默认联编程序, match 包含多个属性,这些属性同样适合 returnTypeindexes

对于默认绑定器, matchnull 空数组。

注解

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

适用于

另请参阅