Module.GetMethod Método

Definição

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

Sobrecargas

GetMethod(String)

Retorna um método com o nome especificado.

GetMethod(String, Type[])

Retorna um método com os tipos de parâmetro e nome especificados.

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

Retorna um método contendo o nome especificado, informações de associação, convenção de chamada e tipos de parâmetro e modificadores.

GetMethod(String)

Retorna um método com o nome especificado.

public:
 System::Reflection::MethodInfo ^ GetMethod(System::String ^ name);
public System.Reflection.MethodInfo? GetMethod (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.

Retornos

MethodInfo

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

Exceções

name é null.

Aplica-se a

GetMethod(String, Type[])

Retorna um método com os tipos de parâmetro e nome especificados.

public:
 System::Reflection::MethodInfo ^ GetMethod(System::String ^ name, cli::array <Type ^> ^ types);
public System.Reflection.MethodInfo? GetMethod (string name, 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âmetro pelos quais pesquisar.

Retornos

MethodInfo

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

Exceções

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

Aplica-se a

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

Retorna um método contendo o nome especificado, informações de associação, convenção de chamada e tipos de parâmetro e modificadores.

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);
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 sinalizadores de bit BindingFlags usados para controlar a pesquisa.

binder
Binder

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

callConvention
CallingConventions

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

types
Type[]

Os tipos de parâmetro pelos quais pesquisar.

modifiers
ParameterModifier[]

Uma matriz de modificadores de parâmetro usados para fazer a associação funcionar com assinaturas de parâmetro nos quais os tipos foram modificados.

Retornos

MethodInfo

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

Exceções

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

Confira também

Aplica-se a