M_Cyjb_Reflection_PowerBinder_SelectProperty - CYJB/Cyjb GitHub Wiki
基于参数类型,从给定的属性集中选择一个属性。
Namespace: Cyjb.Reflection
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6
C#
public override PropertyInfo? SelectProperty(
BindingFlags bindingAttr,
PropertyInfo[] match,
Type? returnType,
Type[]? indexes,
ParameterModifier[]? modifiers
)
- bindingAttr
- Type: System.Reflection.BindingFlags
BindingFlags 值的按位组合。 - match
- Type: System.Reflection.PropertyInfo[]
用于匹配的候选属性集。 - returnType
- Type: System.Type
匹配属性必须具有的返回值。 - indexes
- Type: System.Type[]
所搜索的属性的索引类型。 - modifiers
- Type: System.Reflection.ParameterModifier[]
使绑定能够处理在其中修改了类型的参数签名的参数修饰符数组。
Type: PropertyInfo
如果找到,则为匹配的属性;否则为 null
。
异常 | 条件 |
---|---|
ArgumentNullException |
match 为 null 。 |
ArgumentNullException |
returnType 为 null 。 |
ArgumentException | match 为空数组。 |
ArgumentException |
match 中包含为 null 的元素。 |
AmbiguousMatchException | match 包含多个与 returnType 匹配程度相同的方法。 |