TypeGetProperty Method (String, Type, Type, ParameterModifier) |
Searches for the specified public property whose parameters match the specified argument types and modifiers.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public PropertyInfo GetProperty(
string name,
Type returnType,
Type[] types,
ParameterModifier[] modifiers
)
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. - 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:
PropertyInfoAn object representing the public property that matches the specified requirements, if found; otherwise, null.
Exceptions Exception | Condition |
---|
AmbiguousMatchException | More than one property is found with the specified name and matching the specified argument types and modifiers. |
ArgumentNullException | name is null.-or- types is null. |
ArgumentException | types is multidimensional.-or- modifiers is multidimensional.-or- types and modifiers do not have the same length. |
NullReferenceException | An element of types is null. |
See Also