PropertyCollection.TryGetProperty<TProperty>(Object, TProperty) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the property associated with the specified key.
public:
generic <typename TProperty>
bool TryGetProperty(System::Object ^ key, [Runtime::InteropServices::Out] TProperty % property);
public bool TryGetProperty<TProperty> (object key, out TProperty property);
member this.TryGetProperty : obj * 'Property -> bool
Public Function TryGetProperty(Of TProperty) (key As Object, ByRef property As TProperty) As Boolean
Type Parameters
- TProperty
The type of the property associated with the specified key.
Parameters
- key
- Object
The key.
- property
- TProperty
The retrieved property, or default(TValue) if there is no property associated with the specified key.
Returns
true
if the property was found, otherwise false
.
Exceptions
key
is null.