Binder.SelectProperty Method

Selects a property from the given set of properties, based on the specified criteria.

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

public abstract PropertyInfo SelectProperty(
	BindingFlags bindingAttr,
	PropertyInfo[] match,
	Type returnType,
	Type[] indexes,
	ParameterModifier[] modifiers
)

Parameters

bindingAttr
Type: System.Reflection.BindingFlags

A bitwise combination of BindingFlags values.

match
Type: System.Reflection.PropertyInfo[]

The set of properties that are candidates for matching. For example, when a Binder object is used by Type.InvokeMember, this parameter specifies the set of properties 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.

returnType
Type: System.Type

The return value the matching property must have.

indexes
Type: System.Type[]

The index types of the property being searched for. Used for index properties such as the indexer for a class.

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: System.Reflection.PropertyInfo
The matching property.

ExceptionCondition
AmbiguousMatchException

For the default binder, match contains multiple properties that are equally good matches for returnType and indexes.

ArgumentException

For the default binder, match is null or an empty array.

This method controls the selection provided by the GetProperty method on Type.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft