IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue) IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue) IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue) IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue) Method

Definition

Gets the value associated with the specified key.

// This member is not implemented in C++/CX
bool TryGetValue(TKey key, out TValue value)
Function TryGetValue(key As TKey, ByRef value As TValue) As Boolean
bool TryGetValue(TKey key, out TValue value)

Parameters

key
TKey TKey TKey TKey

The key whose value to get.

value
TValue TValue TValue 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.

Returns

Boolean Boolean Boolean

true if the object that implements System.Collections.Generic.IDictionary`2 contains an element with the specified key; otherwise, false.

Exceptions

key is null.

See Also

  • System.Collections.Generic.IDictionary`2.ContainsKey(`0)
  • System.Collections.Generic.IDictionary`2.Item(`0)