AccessibleObject.IReflect.GetMethod AccessibleObject.IReflect.GetMethod AccessibleObject.IReflect.GetMethod Method

定义

重载

IReflect.GetMethod(String, BindingFlags) IReflect.GetMethod(String, BindingFlags) IReflect.GetMethod(String, BindingFlags)

在指定的搜索约束下获取与指定方法对应的 MethodInfo 对象。Gets a MethodInfo object corresponding to a specified method under specified search constraints. 有关此成员的说明,请参见 GetMethod(String, BindingFlags)For a description of this member, see GetMethod(String, BindingFlags).

IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]) IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

获取与指定方法对应的 MethodInfo 对象(使用类型数组从重载方法中进行选择)。Gets a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods. 有关此成员的说明,请参见 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])For a description of this member, see GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]).

IReflect.GetMethod(String, BindingFlags) IReflect.GetMethod(String, BindingFlags) IReflect.GetMethod(String, BindingFlags)

在指定的搜索约束下获取与指定方法对应的 MethodInfo 对象。Gets a MethodInfo object corresponding to a specified method under specified search constraints. 有关此成员的说明,请参见 GetMethod(String, BindingFlags)For a description of this member, see GetMethod(String, BindingFlags).

 virtual System::Reflection::MethodInfo ^ System.Reflection.IReflect.GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr) = System::Reflection::IReflect::GetMethod;
System.Reflection.MethodInfo IReflect.GetMethod (string name, System.Reflection.BindingFlags bindingAttr);
Function GetMethod (name As String, bindingAttr As BindingFlags) As MethodInfo Implements IReflect.GetMethod

参数

name
String String String

要查找的成员的名称。The name of the member to find.

bindingAttr
BindingFlags BindingFlags BindingFlags

用于控制搜索的绑定属性。The binding attributes used to control the search.

返回

包含方法信息的 MethodInfo 对象,匹配基于方法名和 bindingAttr 中指定的搜索约束。A MethodInfo object containing the method information, with the match being based on the method name and search constraints specified in bindingAttr.

实现

异常

该对象实现同名的多个方法。The object implements multiple methods with the same name.

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 AccessibleObject 实例被强制转换为 IReflect 接口时使用。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]) IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

获取与指定方法对应的 MethodInfo 对象(使用类型数组从重载方法中进行选择)。Gets a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods. 有关此成员的说明,请参见 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])For a description of this member, see GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]).

 virtual System::Reflection::MethodInfo ^ System.Reflection.IReflect.GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers) = System::Reflection::IReflect::GetMethod;
System.Reflection.MethodInfo IReflect.GetMethod (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type[] types, System.Reflection.ParameterModifier[] modifiers);

参数

name
String String String

要查找的成员的名称。The name of the member to find.

bindingAttr
BindingFlags BindingFlags BindingFlags

用于控制搜索的绑定属性。The binding attributes used to control the search.

binder
Binder Binder Binder

一个实现 Binder 的对象,包含与此方法相关的属性。An object that implements Binder, containing properties related to this method.

types
Type[]

用于从重载方法中进行选择的数组。An array used to choose among overloaded methods.

modifiers
ParameterModifier[]

参数修饰符的数组,用于使绑定可与在其中修改了类型的参数签名一起使用。An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.

返回

匹配所有指定参数的请求的方法。The requested method that matches all the specified parameters.

实现

异常

该对象实现同名的多个方法。The object implements multiple methods with the same name.

注解

返回值是基于方法名称、System.Reflection.BindingFlags 枚举、binder 参数指定的类型转换类型、重载,以及描述方法签名的 System.Reflection.ParameterInfo 的匹配项。The return value is a match based on the method name, the System.Reflection.BindingFlags enumeration, the kind of type conversion specified by the binder parameter, the overload, and the System.Reflection.ParameterInfo that describes the signature of the method.

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 AccessibleObject 实例被强制转换为 IReflect 接口时使用。It can be used only when the AccessibleObject instance is cast to an IReflect interface.

适用于