Method TryGetValue
TryGetValue(TAlternateKey, out TValue)
Gets the value associated with the specified alternate key.
Declaration
public bool TryGetValue(TAlternateKey key, out TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TAlternateKey | key | The alternate key of the value to get. |
| TValue | value | When this method returns, contains the value associated with the key if it was found and is still available; otherwise null. |
Returns
| Type | Description |
|---|---|
| bool | true if the key was found and its value is still available; otherwise false. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The dictionary has been disposed. |
TryGetValue(TAlternateKey, out TKey, out TValue)
Gets the value associated with the specified alternate key.
Declaration
public bool TryGetValue(TAlternateKey key, out TKey actualKey, out TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TAlternateKey | key | The alternate key of the value to get. |
| TKey | actualKey | When this method returns, contains the key instance stored in the dictionary if the key was found; otherwise the default value. |
| TValue | value | When this method returns, contains the value associated with the key if it was found and is still available; otherwise null. |
Returns
| Type | Description |
|---|---|
| bool | true if the key was found and its value is still available; otherwise false. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | The dictionary has been disposed. |