MemberDescriptor.FindMethod 方法

定義

透過反映搜尋指定的方法。

多載

FindMethod(Type, String, Type[], Type)

透過反映搜尋指定的方法,只搜尋公用 (Public) 方法。

FindMethod(Type, String, Type[], Type, Boolean)

使用只搜尋公用方法的選項,透過反映搜尋指定的方法。

FindMethod(Type, String, Type[], Type)

來源:
MemberDescriptor.cs
來源:
MemberDescriptor.cs
來源:
MemberDescriptor.cs

透過反映搜尋指定的方法,只搜尋公用 (Public) 方法。

protected:
 static System::Reflection::MethodInfo ^ FindMethod(Type ^ componentClass, System::String ^ name, cli::array <Type ^> ^ args, Type ^ returnType);
protected static System.Reflection.MethodInfo FindMethod (Type componentClass, string name, Type[] args, Type returnType);
protected static System.Reflection.MethodInfo? FindMethod (Type componentClass, string name, Type[] args, Type returnType);
static member FindMethod : Type * string * Type[] * Type -> System.Reflection.MethodInfo
Protected Shared Function FindMethod (componentClass As Type, name As String, args As Type(), returnType As Type) As MethodInfo

參數

componentClass
Type

包含方法的元件。

name
String

要搜尋的方法名稱。

args
Type[]

方法的參數陣列,用來在多載的方法之間選擇。

returnType
Type

要傳回的方法型別。

傳回

MethodInfo,表示方法;如果找不到方法,則為 null

適用於

FindMethod(Type, String, Type[], Type, Boolean)

來源:
MemberDescriptor.cs
來源:
MemberDescriptor.cs
來源:
MemberDescriptor.cs

使用只搜尋公用方法的選項,透過反映搜尋指定的方法。

protected:
 static System::Reflection::MethodInfo ^ FindMethod(Type ^ componentClass, System::String ^ name, cli::array <Type ^> ^ args, Type ^ returnType, bool publicOnly);
protected static System.Reflection.MethodInfo FindMethod (Type componentClass, string name, Type[] args, Type returnType, bool publicOnly);
protected static System.Reflection.MethodInfo? FindMethod (Type componentClass, string name, Type[] args, Type returnType, bool publicOnly);
static member FindMethod : Type * string * Type[] * Type * bool -> System.Reflection.MethodInfo
Protected Shared Function FindMethod (componentClass As Type, name As String, args As Type(), returnType As Type, publicOnly As Boolean) As MethodInfo

參數

componentClass
Type

包含方法的元件。

name
String

要搜尋的方法名稱。

args
Type[]

方法的參數陣列,用來在多載的方法之間選擇。

returnType
Type

要傳回的方法型別。

publicOnly
Boolean

是否將搜尋限制在公用方法。

傳回

MethodInfo,表示方法;如果找不到方法,則為 null

適用於