IReflect.GetMethod Método
Definición
Recupera un objeto MethodInfo que se corresponde con un método especificado.Retrieves a MethodInfo object that corresponds to a specified method.
Sobrecargas
GetMethod(String, BindingFlags) |
Recupera un objeto MethodInfo que se corresponde con un método especificado con unas determinadas restricciones de búsqueda.Retrieves a MethodInfo object that corresponds to a specified method under specified search constraints. |
GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]) |
Recupera un objeto MethodInfo correspondiente a un método especificado, utilizando una matriz Type para elegir entre varios métodos sobrecargados.Retrieves a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods. |
GetMethod(String, BindingFlags)
Recupera un objeto MethodInfo que se corresponde con un método especificado con unas determinadas restricciones de búsqueda.Retrieves a MethodInfo object that corresponds to a specified method under specified search constraints.
public:
System::Reflection::MethodInfo ^ GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public System.Reflection.MethodInfo GetMethod (string name, System.Reflection.BindingFlags bindingAttr);
abstract member GetMethod : string * System.Reflection.BindingFlags -> System.Reflection.MethodInfo
Public Function GetMethod (name As String, bindingAttr As BindingFlags) As MethodInfo
Parámetros
- name
- String
Nombre del miembro que se va a buscar.The name of the member to find.
- bindingAttr
- BindingFlags
Atributos de enlace utilizados para controlar la búsqueda.The binding attributes used to control the search.
Devoluciones
Objeto MethodInfo que contiene información del método, donde las coincidencias se establecen en función del nombre del método y con las restricciones de búsqueda especificadas en bindingAttr
.A MethodInfo object containing the method information, with the match being based on the method name and search constraints specified in bindingAttr
.
Excepciones
El objeto implementa varios métodos con el mismo nombre.The object implements multiple methods with the same name.
Consulte también:
GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])
Recupera un objeto MethodInfo correspondiente a un método especificado, utilizando una matriz Type para elegir entre varios métodos sobrecargados.Retrieves a MethodInfo object corresponding to a specified method, using a Type array to choose from among overloaded methods.
public:
System::Reflection::MethodInfo ^ GetMethod(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, 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, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetMethod : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Parámetros
- name
- String
Nombre del miembro que se va a buscar.The name of the member to find.
- bindingAttr
- BindingFlags
Atributos de enlace utilizados para controlar la búsqueda.The binding attributes used to control the search.
- binder
- Binder
Un objeto que implementa Binder y que contiene propiedades relacionadas con este método.An object that implements Binder, containing properties related to this method.
- types
- Type[]
Matriz utilizada para elegir entre varios métodos sobrecargados.An array used to choose among overloaded methods.
- 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.An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.
Devoluciones
Método solicitado que coincide con todos los parámetros especificados.The requested method that matches all the specified parameters.
Excepciones
El objeto implementa varios métodos con el mismo nombre.The object implements multiple methods with the same name.
Comentarios
El valor devuelto es una coincidencia basada en el nombre del BindingFlags método, el miembro de enumeración, el tipo de binder
conversión de tipo especificado por el parámetro ParameterInfo , la sobrecarga y el que describe la firma del método.The return value is a match based on the method name, BindingFlags enum member, the kind of type conversion specified by the binder
parameter, the overload, and the ParameterInfo that describes the signature of the method.