Click or drag to resize
TypeGetProperty Method (String, Type, Type)
Searches for the specified public property whose parameters match the specified argument types.

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

Parameters

name
Type: SystemString
The string containing the name of the public property to get.
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.

Return Value

Type: PropertyInfo
An object representing the public property whose parameters match the specified argument types, if found; otherwise, null.
Exceptions
ExceptionCondition
AmbiguousMatchExceptionMore than one property is found with the specified name and matching the specified argument types.
ArgumentNullExceptionname is null.-or- types is null.
ArgumentExceptiontypes is multidimensional.
NullReferenceExceptionAn element of types is null.
See Also