Open sandboxFocus

Method GetMethod

GetMethod(Type, string, BindingFlags, string)

Gets a method from a type by its name, binding flags, and MethodInfo.ToString() signature.

Declaration
public static MethodInfo GetMethod(this Type type, string methodName, BindingFlags bindingFlags, string signature)
Parameters
Type Name Description
Type type

The type containing the method.

string methodName

The name of the method.

BindingFlags bindingFlags

The binding flags to use when searching for the method.

string signature

The full signature of the method as returned by MethodInfo.ToString().

Returns
Type Description
MethodInfo

The MethodInfo matching the specified criteria.

Exceptions
Type Condition
InvalidOperationException

No method with the specified signature was found.

AmbiguousMatchException

More than one method with the specified signature was found.