Gets the value associated with the specified key.

Namespace: System.Extensions.Collections.ObjectModel
Assembly: System.Extensions (in System.Extensions.dll) Version: 0.0.0.5 (0.0.0.5)

Syntax

C#
public bool TryGetValue(
	TKey key,
	out TValue value
)
Visual Basic
Public Function TryGetValue ( 
	key As TKey,
	<OutAttribute> ByRef value As TValue
) As Boolean
Visual C++
public:
virtual bool TryGetValue(
	TKey key, 
	[OutAttribute] TValue% value
) sealed
F#
abstract TryGetValue : 
        key : 'TKey * 
        value : 'TValue byref -> bool 
override TryGetValue : 
        key : 'TKey * 
        value : 'TValue byref -> bool 

Parameters

key
Type: TKey
The key of the item to get.
value
Type: TValue%
The item if found, otherwise the default value for the type.

Return Value

Type: Boolean
True if the item is found, false otherwise.

Implements

IDictionary<(Of <(<'TKey, TValue>)>)>..::..TryGetValue(TKey, TValue%)

See Also