Module.GetMethod Module.GetMethod Module.GetMethod Module.GetMethod Method

Definition

Returns a method having the specified criteria.

Overloads

GetMethod(String) GetMethod(String) GetMethod(String) GetMethod(String)

Returns a method having the specified name.

GetMethod(String, Type[]) GetMethod(String, Type[]) GetMethod(String, Type[]) GetMethod(String, Type[])

Returns a method having the specified name and parameter types.

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

Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers.

GetMethod(String) GetMethod(String) GetMethod(String) GetMethod(String)

Returns a method having the specified name.

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

Parameters

name
String String String String

The method name.

Returns

A MethodInfo object having the specified name, or null if the method does not exist.

Exceptions

GetMethod(String, Type[]) GetMethod(String, Type[]) GetMethod(String, Type[]) GetMethod(String, Type[])

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);
member this.GetMethod : string * Type[] -> System.Reflection.MethodInfo
Public Function GetMethod (name As String, types As Type()) As MethodInfo

Parameters

name
String String String String

The method name.

types
Type[]

The parameter types to search for.

Returns

A MethodInfo object in accordance with the specified criteria, or null if the method does not exist.

Exceptions

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

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

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);
member this.GetMethod : string * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo

Parameters

name
String String String String

The method name.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

One of the BindingFlags bit flags used to control the search.

binder
Binder Binder Binder Binder

An object that implements Binder, containing properties related to this method.

callConvention
CallingConventions CallingConventions CallingConventions CallingConventions

The calling convention for the method.

types
Type[]

The parameter types to search for.

modifiers
ParameterModifier[]

An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified.

Returns

A MethodInfo object in accordance with the specified criteria, or null if the method does not exist.

Exceptions

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

See also

Applies to