Binder.SelectMethod 方法

基于参数类型,从给定的方法集中选择一个方法。

**命名空间:**System.Reflection
**程序集:**mscorlib(在 mscorlib.dll 中)

语法

声明
Public MustOverride Function SelectMethod ( _
    bindingAttr As BindingFlags, _
    match As MethodBase(), _
    types As Type(), _
    modifiers As ParameterModifier() _
) As MethodBase
用法
Dim instance As Binder
Dim bindingAttr As BindingFlags
Dim match As MethodBase()
Dim types As Type()
Dim modifiers As ParameterModifier()
Dim returnValue As MethodBase

returnValue = instance.SelectMethod(bindingAttr, match, types, modifiers)
public abstract MethodBase SelectMethod (
    BindingFlags bindingAttr,
    MethodBase[] match,
    Type[] types,
    ParameterModifier[] modifiers
)
public:
virtual MethodBase^ SelectMethod (
    BindingFlags bindingAttr, 
    array<MethodBase^>^ match, 
    array<Type^>^ types, 
    array<ParameterModifier>^ modifiers
) abstract
public abstract MethodBase SelectMethod (
    BindingFlags bindingAttr, 
    MethodBase[] match, 
    Type[] types, 
    ParameterModifier[] modifiers
)
public abstract function SelectMethod (
    bindingAttr : BindingFlags, 
    match : MethodBase[], 
    types : Type[], 
    modifiers : ParameterModifier[]
) : MethodBase

参数

  • match
    已被 Reflection 确定为可能的匹配项的方法集,通常是因为它们有正确的成员名称。
  • types
    用于定位匹配方法的值。
  • modifiers
    使绑定能够处理在其中修改了类型的参数签名的参数修饰符数组。

返回值

如果找到,为包含匹配方法的 MethodBase 对象;否则为 空引用(在 Visual Basic 中为 Nothing)。

备注

如果没有与该判据匹配的方法,则此方法应返回 空引用(在 Visual Basic 中为 Nothing)。此方法控制 Type 上的 GetConstructorGetMethod 方法提供的选项。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

Binder 类
Binder 成员
System.Reflection 命名空间