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
- key
Type: System.Object
The key.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.