Module.GetMethod Método

Definición

Devuelve un método con los criterios especificados.

Sobrecargas

GetMethod(String)

Devuelve un método que tiene el nombre especificado.

GetMethod(String, Type[])

Devuelve un método con los tipos de parámetro y nombre especificados.

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

Devuelve un método con el nombre especificado, información de enlace, convención de llamada y tipos de parámetros y modificadores.

GetMethod(String)

Devuelve un método que tiene el nombre 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

El nombre del método.

Devoluciones

MethodInfo

Objeto MethodInfo con el nombre especificado, o null si no existe el método.

Excepciones

name es null.

Se aplica a

GetMethod(String, Type[])

Devuelve un método con los tipos de parámetro y nombre 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

El nombre del método.

types
Type[]

Tipos de parámetro que se van a buscar.

Devoluciones

MethodInfo

Un objeto MethodInfo conforme con los criterios especificados, o null si el método no existe.

Excepciones

name es null, types es null o types (i) es null.

Se aplica a

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

Devuelve un método con el nombre especificado, información de enlace, convención de llamada y tipos de parámetros y 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

El nombre del método.

bindingAttr
BindingFlags

Una de las marcas de bits BindingFlags usadas para controlar la búsqueda.

binder
Binder

Un objeto que implementa Binder y que contiene propiedades relacionadas con este método.

callConvention
CallingConventions

Convención de llamada del método.

types
Type[]

Tipos de parámetro que se van a buscar.

modifiers
ParameterModifier[]

Matriz de modificadores de parámetro que se usa para que el enlace funcione con firmas de parámetro en las que se han modificado los tipos.

Devoluciones

MethodInfo

Un objeto MethodInfo conforme con los criterios especificados, o null si el método no existe.

Excepciones

name es null, types es null o types (i) es null.

Consulte también

Se aplica a