ImmutableSortedDictionary<TKey,TValue>.TryGetKey(TKey, TKey) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷此字典是否包含指定的索引鍵。
public:
virtual bool TryGetKey(TKey equalKey, [Runtime::InteropServices::Out] TKey % actualKey);
public bool TryGetKey(TKey equalKey, out TKey actualKey);
abstract member TryGetKey : 'Key * 'Key -> bool
override this.TryGetKey : 'Key * 'Key -> bool
Public Function TryGetKey (equalKey As TKey, ByRef actualKey As TKey) As Boolean
參數
- equalKey
- TKey
要搜尋的鍵。
- actualKey
- TKey
若找到 equalkey ,則以字典中匹配的金鑰,或未找到匹配。
傳回
true若找到匹配,equalKey則 。 false
實作
備註
以下是一些可能有用的情境 TryGetKey :
你想重用之前儲存的物件參考,而不是建立新的參考。
你要查詢一個物件的典範值
你想要取得關於一個物件更完整的資料