Dictionary<TKey,TValue>.TryGetAlternateLookup<TAlternateKey> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
獲得一個型 Dictionary<TKey,TValue> 態的實例,可用 a TAlternateKey 作為鍵而非 TKey。
public:
generic <typename TAlternateKey>
bool TryGetAlternateLookup([Runtime::InteropServices::Out] System::Collections::Generic::Dictionary<TKey, TValue>::AlternateLookup<TAlternateKey> % lookup);
public bool TryGetAlternateLookup<TAlternateKey>(out System.Collections.Generic.Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> lookup) where TAlternateKey : allows ref struct;
member this.TryGetAlternateLookup : AlternateLookup -> bool
Public Function TryGetAlternateLookup(Of TAlternateKey) (ByRef lookup As Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)) As Boolean
類型參數
- TAlternateKey
用於查找的另一種金鑰。
參數
當方法回傳 true 時所建立的查詢實例,或若方法回傳 false,則不應該使用的預設實例。
傳回
true如果能建立查詢;否則,。 false
備註
字典必須使用一個比較 IAlternateEqualityComparer<TAlternate,T> 器,實現 與 TAlternateKeyTKey。 若不行,則方法返回 false。