[This is preliminary documentation and is subject to change.]

Gets the value associated with the specified key.

Namespace: Tools.CollectionsT.GenericT
Assembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public bool TryGetValue(
	TKey key,
	ref TValue value
)
Visual Basic
Public Function TryGetValue ( _
	key As TKey, _
	ByRef value As TValue _
) As Boolean
Visual C++
public:
virtual bool TryGetValue(
	TKey key, 
	TValue% value
) sealed
F#
abstract TryGetValue : 
        key:'TKey * 
        value:'TValue byref -> bool 
override TryGetValue : 
        key:'TKey * 
        value:'TValue byref -> bool 
JScript
public final function TryGetValue(
	key : TKey, 
	value : TValue
) : boolean

Parameters

key
Type: TKey
The key whose value to get.
value
Type: TValue%
When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Return Value

true if the object that implements IDictionary<(Of <(<'TKey, TValue>)>)> contains an element with the specified key; otherwise, false.

Implements

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

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionkey is null.

See Also