Retrieves a PropertyInfo object corresponding to a specified property under specified search constraints.
[Visual Basic] Overloads Function GetProperty( _ ByVal name As String, _ ByVal bindingAttr As BindingFlags _ ) As PropertyInfo [C#] PropertyInfo GetProperty( string name, BindingFlags bindingAttr ); [C++] PropertyInfo* GetProperty( String* name, BindingFlags bindingAttr ) = 0; [JScript] function GetProperty( name : String, bindingAttr : BindingFlags ) : PropertyInfo;
Value | Condition |
---|---|
A PropertyInfo object for the located property. | A property with the given name was located in this reflection object. |
null | The property was not located. |
Exception Type | Condition |
---|---|
AmbiguousMatchException | If the object implements multiple fields with the same name. |
The GetProperty method retrieves a PropertyInfo object that corresponds to a specified property using a specified name and binding attribute.An example of a binding attribute value is IgnoreCase.
IReflect Interface | IReflect Members | System.Reflection Namespace | IReflect.GetProperty Overload List | String | BindingFlags