共用方式為


PropertyCollection.GetProperty<TProperty> Method (Object)

Gets the property associated with the specified key.

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

Syntax

'宣告
Public Function GetProperty(Of TProperty) ( _
    key As Object _
) As TProperty
public TProperty GetProperty<TProperty>(
    Object key
)
public:
generic<typename TProperty>
TProperty GetProperty(
    Object^ key
)
member GetProperty : 
        key:Object -> 'TProperty 
JScript does not support generic types or methods.

Type Parameters

  • TProperty
    The type of the property.

Parameters

Return Value

Type: TProperty
The property value, or nulla null reference (Nothing in Visual Basic) if the property is not set.

Exceptions

Exception Condition
ArgumentNullException

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

KeyNotFoundException

key does not exist in the property collection.

.NET Framework Security

See Also

Reference

PropertyCollection Class

GetProperty Overload

Microsoft.VisualStudio.Utilities Namespace