Module.GetMethod Método

Definição

Retorna um método com os critérios especificados.Returns a method having the specified criteria.

Sobrecargas

GetMethod(String)

Retorna um método com o nome especificado.Returns a method having the specified name.

GetMethod(String, Type[])

Retorna um método com os tipos de parâmetro e nome especificados.Returns a method having the specified name and parameter types.

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.Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.

GetMethod(String)

Retorna um método com o nome especificado.Returns a method having the specified name.

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.The method name.

Retornos

MethodInfo

Um objeto MethodInfo com o nome especificado ou null, se o método não existir.A MethodInfo object having the specified name, or null if the method does not exist.

Exceções

name é null.name is null.

Aplica-se a

GetMethod(String, Type[])

Retorna um método com os tipos de parâmetro e nome especificados.Returns a method having the specified name and parameter types.

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.The method name.

types
Type[]

Os tipos de parâmetro pelos quais pesquisar.The parameter types to search for.

Retornos

MethodInfo

Um objeto MethodInfo de acordo com os critérios especificados ou null se o método não existir.A MethodInfo object in accordance with the specified criteria, or null if the method does not exist.

Exceções

name é null, types é null ou types (i) é null.name is null, types is null, or types (i) is 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.Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.

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.The method name.

bindingAttr
BindingFlags

Um dos sinalizadores de bit BindingFlags usados para controlar a pesquisa.One of the BindingFlags bit flags used to control the search.

binder
Binder

Um objeto que implementa Binder, contendo as propriedades relacionadas a este método.An object that implements Binder, containing properties related to this method.

callConvention
CallingConventions

A convenção de chamada para o método.The calling convention for the method.

types
Type[]

Os tipos de parâmetro pelos quais pesquisar.The parameter types to search for.

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.An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.

Retornos

MethodInfo

Um objeto MethodInfo de acordo com os critérios especificados ou null se o método não existir.A MethodInfo object in accordance with the specified criteria, or null if the method does not exist.

Exceções

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

Confira também

Aplica-se a