Returns a System.Reflection.PropertyInfo object that reflects the public property defined in the type represented by the current instance that has the specified name.
- name
- A string containing the name of the property to be returned.
A System.Reflection.PropertyInfo object reflecting the public property defined on the type represented by the current instance that has the specified name. If no matching property is found, returns null .
Type Reason System.Reflection.AmbiguousMatchException More than one property matching the specified criteria was found. ArgumentNullException name is null.
This version of Type.GetProperty(string, System.Reflection.BindingFlags, System.Reflection.Binder, Type, Type[], System.Reflection.ParameterModifier[]) is equivalent to Type.GetPropertyImpl(string, System.Reflection.BindingFlags, System.Reflection.Binder, Type, Type[], System.Reflection.ParameterModifier[])(name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, null, null, null, null).
The search for name is case-sensitive.
If the current instance represents a generic type, this method returns the System.Reflection.PropertyInfo with the type parameters replaced by the appropriate type arguments.
If the current instance represents an unassigned type parameter of a generic type or method, this method searches the properties of the class constraint; the properties of all interface constraints; and the properties of any interfaces inherited from class or interface constraints.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0