Επεξεργασία

Κοινή χρήση μέσω


MemberDescriptor.FindMethod Method

Definition

Finds the given method through reflection.

Overloads

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

Finds the given method through reflection, searching only for public methods.

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

Finds the given method through reflection, with an option to search only public methods.

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

Source:
MemberDescriptor.cs
Source:
MemberDescriptor.cs
Source:
MemberDescriptor.cs

Finds the given method through reflection, searching only for public methods.

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

Parameters

componentClass
Type

The component that contains the method.

name
String

The name of the method to find.

args
Type[]

An array of parameters for the method, used to choose between overloaded methods.

returnType
Type

The type to return for the method.

Returns

A MethodInfo that represents the method, or null if the method is not found.

Applies to

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

Source:
MemberDescriptor.cs
Source:
MemberDescriptor.cs
Source:
MemberDescriptor.cs

Finds the given method through reflection, with an option to search only public methods.

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

Parameters

componentClass
Type

The component that contains the method.

name
String

The name of the method to find.

args
Type[]

An array of parameters for the method, used to choose between overloaded methods.

returnType
Type

The type to return for the method.

publicOnly
Boolean

Whether to restrict search to public methods.

Returns

A MethodInfo that represents the method, or null if the method is not found.

Applies to