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
'宣告
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: System.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: System.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
- 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.