M_Cyjb_Reflection_PowerBinder_BindToMethod - CYJB/Cyjb GitHub Wiki
基于提供的参数,从给定的方法集中选择要调用的方法。
Namespace: Cyjb.Reflection
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6
C#
public override MethodBase BindToMethod(
BindingFlags bindingAttr,
MethodBase[] match,
ref Object?[]? args,
ParameterModifier[]? modifiers,
CultureInfo? culture,
string[]? names,
out Object?? state
)
- bindingAttr
- Type: System.Reflection.BindingFlags
BindingFlags 值的按位组合。 - match
- Type: System.Reflection.MethodBase[]
用于匹配的候选方法集。 - args
- Type: System.Object[]
传入的参数。 - modifiers
- Type: System.Reflection.ParameterModifier[]
使绑定能够处理在其中修改了类型的参数签名的参数修饰符数组。 - culture
- Type: System.Globalization.CultureInfo
一个 CultureInfo 实例, 用于在强制类型的联编程序实现中控制数据类型强制。 - names
- Type: System.String[]
参数名(如果匹配时要考虑参数名)或null
(如果要将变量视为纯位置)。 - state
- Type: System.Object
方法返回之后,state 包含一个联编程序提供的对象, 用于跟踪参数的重新排序。
Type: MethodBase
匹配的方法。
异常 | 条件 |
---|---|
ArgumentNullException |
match 为 null 。 |
ArgumentNullException |
args 为 null 。 |
ArgumentException | match 为空数组。 |
ArgumentException |
match 中包含为 null 的元素。 |
AmbiguousMatchException | match 包含多个与 args 匹配程度相同的方法。 |
MissingFieldException | bindingAttr 包含 SetField,且 match 不包含任何可接受 args 的方法。 |