Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>.TryGetValue 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| TryGetValue(TAlternateKey, TValue) |
取得與指定替代鍵相關的值。 |
| TryGetValue(TAlternateKey, TKey, TValue) |
取得與指定替代鍵相關的值。 |
TryGetValue(TAlternateKey, TValue)
取得與指定替代鍵相關的值。
public:
bool TryGetValue(TAlternateKey key, [Runtime::InteropServices::Out] TValue % value);
public bool TryGetValue(TAlternateKey key, out TValue value);
member this.TryGetValue : 'AlternateKey * 'Value -> bool
Public Function TryGetValue (key As TAlternateKey, ByRef value As TValue) As Boolean
參數
- key
- TAlternateKey
另一個鍵是 取值。
- value
- TValue
當此方法回傳時,包含與指定鍵相關聯的值,若找到該鍵;否則,則為該值參數型別的預設值。
傳回
true若發現條目;否則,。 false
例外狀況
key 是 null。
適用於
TryGetValue(TAlternateKey, TKey, TValue)
取得與指定替代鍵相關的值。
public:
bool TryGetValue(TAlternateKey key, [Runtime::InteropServices::Out] TKey % actualKey, [Runtime::InteropServices::Out] TValue % value);
public bool TryGetValue(TAlternateKey key, out TKey actualKey, out TValue value);
member this.TryGetValue : 'AlternateKey * 'Key * 'Value -> bool
Public Function TryGetValue (key As TAlternateKey, ByRef actualKey As TKey, ByRef value As TValue) As Boolean
參數
- key
- TAlternateKey
另一個鍵是 取值。
- actualKey
- TKey
當此方法回傳時,包含與該替代鍵對應的實際金鑰(若找到該金鑰);否則,則為鍵參數型別的預設值。
- value
- TValue
當此方法回傳時,包含與指定鍵相關聯的值,若找到該鍵;否則,則為該值參數型別的預設值。
傳回
true若發現條目;否則,。 false
例外狀況
key 是 null。