Click or drag to resize
TypeGetProperty Method (String, BindingFlags, Binder, Type, Type, ParameterModifier)
Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public PropertyInfo GetProperty(
	string name,
	BindingFlags bindingAttr,
	Binder binder,
	Type returnType,
	Type[] types,
	ParameterModifier[] modifiers
)

Parameters

name
Type: SystemString
The string containing the name of the property to get.
bindingAttr
Type: System.ReflectionBindingFlags
A bitmask comprised of one or more BindingFlags that specify how the search is conducted.-or- Zero, to return null.
binder
Type: System.ReflectionBinder
An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.-or- A null reference (Nothing in Visual Basic), to use the DefaultBinder.
returnType
Type: SystemType
The return type of the property.
types
Type: SystemType
An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.-or- An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
modifiers
Type: System.ReflectionParameterModifier
An array of ParameterModifier objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter.

Return Value

Type: PropertyInfo
An object representing the property that matches the specified requirements, if found; otherwise, null.

Implements

IReflectGetProperty(String, BindingFlags, Binder, Type, Type, ParameterModifier)
Exceptions
ExceptionCondition
AmbiguousMatchExceptionMore than one property is found with the specified name and matching the specified binding constraints.
ArgumentNullExceptionname is null.-or- types is null.
ArgumentExceptiontypes is multidimensional.-or- modifiers is multidimensional.-or- types and modifiers do not have the same length.
NullReferenceExceptionAn element of types is null.
See Also