다음을 통해 공유


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)

Syntax

'Declaration
Public Function TryGetProperty(Of TProperty) ( _
    key As Object, _
    <OutAttribute> ByRef property As TProperty _
) As Boolean
public bool TryGetProperty<TProperty>(
    Object key,
    out TProperty property
)
public:
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.

Parameters

  • key
    Type: Object

    The key.

  • property
    Type: TProperty%

    The retrieved property, or default(TValue) if there is no property associated with the specified key.

Return Value

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

Exceptions

Exception Condition
ArgumentNullException

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

.NET Framework Security

See Also

Reference

PropertyCollection Class

Microsoft.VisualStudio.Utilities Namespace