Binder.SelectProperty(BindingFlags, PropertyInfo[], Type, Type[], ParameterModifier[]) 方法

定义

基于指定的判据,从给定的属性集中选择一个属性。Selects a property from the given set of properties, based on the specified criteria.

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 值的按位组合。A bitwise combination of BindingFlags values.

match
PropertyInfo[]

用于匹配的候选属性集。The set of properties that are candidates for matching. 例如,当 Binder 使用 InvokeMember 对象时,此参数将指定反射已确定为可能匹配项的属性集,通常是因为它们有正确的成员名称。For example, when a Binder object is used by InvokeMember, this parameter specifies the set of properties that reflection has determined to be possible matches, typically because they have the correct member name. DefaultBinder 提供的默认实现会更改此数组的顺序。The default implementation provided by DefaultBinder changes the order of this array.

returnType
Type

匹配属性必须具有的返回值。The return value the matching property must have.

indexes
Type[]

所搜索的属性的索引类型。The index types of the property being searched for. 用于索引属性,如类的索引器。Used for index properties such as the indexer for a class.

modifiers
ParameterModifier[]

使绑定能够处理在其中修改了类型的参数签名的参数修饰符数组。An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified.

返回

PropertyInfo

匹配的属性。The matching property.

例外

对于默认联编程序,match 包含多个与 returnTypeindexes 良好匹配且匹配程序相同的属性。For the default binder, match contains multiple properties that are equally good matches for returnType and indexes.

对于默认联编程序,matchnull 或一个空数组。For the default binder, match is null or an empty array.

注解

此方法控制上的方法提供的选择 GetProperty TypeThis method controls the selection provided by the GetProperty method on Type.

适用于

另请参阅