TypeInfo.GetDeclaredMethod(String) 方法

定义

返回表示由当前类型声明的指定公共方法的对象。Returns an object that represents the specified public method declared by the current type.

public:
 virtual System::Reflection::MethodInfo ^ GetDeclaredMethod(System::String ^ name);
public virtual System.Reflection.MethodInfo GetDeclaredMethod (string name);
abstract member GetDeclaredMethod : string -> System.Reflection.MethodInfo
override this.GetDeclaredMethod : string -> System.Reflection.MethodInfo
Public Overridable Function GetDeclaredMethod (name As String) As MethodInfo

参数

name
String

方法的名称。The name of the method.

返回

如果找到对象,则为表示指定的方法的对象;否则为 nullAn object that represents the specified method, if found; otherwise, null.

异常

namenullname is null.

适用于