PropertyCollection.TryGetProperty<TProperty> Method

Gets the property associated with the specified key.

Namespace:  Microsoft.VisualStudio.Utilities
Assembly:  Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)


Public Function TryGetProperty(Of TProperty) ( _
    key As Object, _
    <OutAttribute> ByRef property As TProperty _
) As Boolean
public bool TryGetProperty<TProperty>(
    Object key,
    out TProperty property
generic<typename TProperty>
bool TryGetProperty(
    Object^ key, 
    [OutAttribute] TProperty% property
member TryGetProperty : 
        key:Object * 
        property:'TProperty byref -> bool 
JScript does not support generic types or methods.

Type Parameters

  • TProperty
    The type of the property associated with the specified key.


  • property
    Type: TProperty%
    The retrieved property, or default(TValue) if there is no property associated with the specified key.

Return Value

Type: System.Boolean
true if the property was found, otherwise false.


Exception Condition

key is nulla null reference (Nothing in Visual Basic).

.NET Framework Security

See Also


PropertyCollection Class

Microsoft.VisualStudio.Utilities Namespace