CustomReflectionBinder.SelectMethod Method |
Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public override MethodBase SelectMethod( BindingFlags bindingFlags, MethodBase[] match, Type[] types, ParameterModifier[] modifiers )
Parameters
- bindingFlags
- Type: System.Reflection.BindingFlags
- match
- Type: System.Reflection.MethodBase[]
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. - types
- Type: System.Type[]
The parameter types used to locate a matching method. - modifiers
- Type: System.Reflection.ParameterModifier[]
An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified.
Return Value
Type: MethodBaseThe matching method, if found; otherwise, null.
Exception | Condition |
---|---|
AmbiguousMatchException | For the default binder, match contains multiple methods that are equally good matches for the parameter types described by types. For example, the array in types contains a Type object for MyClass and the array in match contains a method that takes a base class of MyClass and a method that takes an interface that MyClass implements. |
ArgumentException | For the default binder, match is null or an empty array.-or-An element of types derives from Type, but is not of type RuntimeType. |