PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Reflection Namespace / Custom­Reflection­Binder Class / Custom­Reflection­Binder Methods / Custom­Reflection­Binder.​Select­Property Method

CustomReflectionBinder.SelectProperty Method

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

Namespace:  PostSharp.Reflection
Assembly:  PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public override PropertyInfo SelectProperty(
	BindingFlags bindingFlags,
	PropertyInfo[] match,
	Type returnType,
	Type[] indexes,
	ParameterModifier[] modifiers


Type: System.Reflection.BindingFlags
Type: System.Reflection.PropertyInfo[]
The set of properties that are candidates for matching. For example, when a Binder object is used by 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 DefaultBinder changes the order of this array.
Type: System.Type
The return value the matching property must have.
Type: System.Type[]
The index types of the property being searched for. Used for index properties such as the indexer for a class.
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: PropertyInfo
The matching property.
AmbiguousMatchExceptionFor the default binder, match contains multiple properties that are equally good matches for returnType and indexes.
ArgumentExceptionFor the default binder, match is null or an empty array.
See Also