Method BindToMethod
BindToMethod(BindingFlags, MethodBase[], ref Object[], ParameterModifier[], CultureInfo, String[], out Object)
Selects a method to invoke from the given set of methods, based on the supplied arguments.
Declaration
public override MethodBase BindToMethod(BindingFlags bindingFlags, MethodBase[] match, ref object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] names, out object state)
Parameters
Type | Name | Description |
---|---|---|
BindingFlags | bindingFlags | |
MethodBase[] | match | The set of methods that are candidates for matching. For example, when a Binder object is used by InvokeMember, this parameter specifies the set of methods that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by DefaultBinder changes the order of this array. |
Object[] | args | The arguments that are passed in. The binder can change the order of the arguments in this array; for example, the default binder changes the order of arguments if the |
ParameterModifier[] | modifiers | An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. The default binder implementation does not use this parameter. |
CultureInfo | culture | An instance of CultureInfo that is used to control the coercion of data types, in binder implementations that coerce types. If |
String[] | names | The parameter names, if parameter names are to be considered when matching, or null if arguments are to be treated as purely positional. For example, parameter names must be used if arguments are not supplied in positional order. |
Object | state | After the method returns, |
Returns
Type | Description |
---|---|
MethodBase | The matching method. |
Exceptions
Type | Condition |
---|---|
AmbiguousMatchException | For the default binder, |
MissingMethodException | For the default binder, |
ArgumentException | For the default binder, |