Module.GetMethod Método

Definição

Devolve um método com os critérios especificados.

Sobrecargas

Name Description
GetMethod(String)

Devolve um método com o nome especificado.

GetMethod(String, Type[])

Devolve um método com o nome e os tipos de parâmetros especificados.

GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Devolve um método com o nome especificado, informação de ligação, convenção de chamada, e tipos e modificadores de parâmetros.

GetMethod(String)

Devolve um método com o nome especificado.

public:
 System::Reflection::MethodInfo ^ GetMethod(System::String ^ name);
public System.Reflection.MethodInfo GetMethod(string name);
member this.GetMethod : string -> System.Reflection.MethodInfo
Public Function GetMethod (name As String) As MethodInfo

Parâmetros

name
String

O nome do método.

Devoluções

Um MethodInfo objeto com o nome especificado, ou null se o método não existir.

Exceções

name é null.

Aplica-se a

GetMethod(String, Type[])

Devolve um método com o nome e os tipos de parâmetros especificados.

public:
 System::Reflection::MethodInfo ^ GetMethod(System::String ^ name, cli::array <Type ^> ^ types);
public System.Reflection.MethodInfo GetMethod(string name, Type[] types);
member this.GetMethod : string * Type[] -> System.Reflection.MethodInfo
Public Function GetMethod (name As String, types As Type()) As MethodInfo

Parâmetros

name
String

O nome do método.

types
Type[]

Os tipos de parâmetros a procurar.

Devoluções

Um MethodInfo objeto de acordo com os critérios especificados, ou null se o método não existir.

Exceções

nameé , é , ou types (i) é null.nulltypesnull

Aplica-se a

GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Devolve um método com o nome especificado, informação de ligação, convenção de chamada, e tipos e modificadores de parâmetros.

public:
 System::Reflection::MethodInfo ^ GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, System::Reflection::CallingConventions callConvention, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
public System.Reflection.MethodInfo GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[] modifiers);
member this.GetMethod : string * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Public Function GetMethod (name As String, bindingAttr As BindingFlags, binder As Binder, callConvention As CallingConventions, types As Type(), modifiers As ParameterModifier()) As MethodInfo

Parâmetros

name
String

O nome do método.

bindingAttr
BindingFlags

Um dos BindingFlags sinalizadores de bits usados para controlar a pesquisa.

binder
Binder

Um objeto que implementa Binder, contendo propriedades relacionadas com este método.

callConvention
CallingConventions

A convenção de chamada para o método.

types
Type[]

Os tipos de parâmetros a procurar.

modifiers
ParameterModifier[]

Um conjunto de modificadores de parâmetros usados para fazer a ligação funcionar com assinaturas de parâmetros nas quais os tipos foram modificados.

Devoluções

Um MethodInfo objeto de acordo com os critérios especificados, ou null se o método não existir.

Exceções

nameé , é , ou types (i) é null.nulltypesnull

Ver também

Aplica-se a