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.

適用於