共用方式為


Binder.SelectProperty Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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

Syntax

'Declaration
Public MustOverride Function SelectProperty ( _
    bindingAttr As BindingFlags, _
    match As PropertyInfo(), _
    returnType As Type, _
    indexes As Type(), _
    modifiers As ParameterModifier() _
) As PropertyInfo
public abstract PropertyInfo SelectProperty(
    BindingFlags bindingAttr,
    PropertyInfo[] match,
    Type returnType,
    Type[] indexes,
    ParameterModifier[] modifiers
)

Parameters

  • match
    Type: array<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: array<System.Type[]
    The index types of the property being searched for. Used for index properties such as the indexer for a class.
  • modifiers
    Type: array<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.

Exceptions

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

Remarks

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.