Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Binder.SelectMethod Method

Selects a method from the given set of methods, based on the argument type.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

public abstract MethodBase SelectMethod (
	BindingFlags bindingAttr,
	MethodBase[] match,
	Type[] types,
	ParameterModifier[] modifiers
)
public abstract MethodBase SelectMethod (
	BindingFlags bindingAttr, 
	MethodBase[] match, 
	Type[] types, 
	ParameterModifier[] modifiers
)
public abstract function SelectMethod (
	bindingAttr : BindingFlags, 
	match : MethodBase[], 
	types : Type[], 
	modifiers : ParameterModifier[]
) : MethodBase
Not applicable.

Parameters

bindingAttr

A bitwise combination of BindingFlags values.

match

The set of methods that are candidates for matching. For example, when a Binder object is used by System.Type.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 Type.DefaultBinder changes the order of this array.

types

The parameter types used to locate a matching method.

modifiers

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

Return Value

The matching method, if found; otherwise, a null reference (Nothing in Visual Basic).
Exception typeCondition

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 a null reference (Nothing in Visual Basic) or an empty array.

-or-

An element of types derives from Type, but is not of type RuntimeType.

This method should return a null reference (Nothing in Visual Basic) if no method matches the criteria. This method controls the selection provided by the GetConstructor and GetMethod methods on Type.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.