語言

ConcurrentDictionary<TKey,TValue>.TryGetAlternateLookup<TAlternateKey> 方法

定義

取得一個型 ConcurrentDictionary<TKey,TValue> 別的實例,可用於使用 a TAlternateKey 作為鍵而非 TKey。

public:
generic <typename TAlternateKey>
 bool TryGetAlternateLookup([Runtime::InteropServices::Out] System::Collections::Concurrent::ConcurrentDictionary<TKey, TValue>::AlternateLookup<TAlternateKey> % lookup);
public bool TryGetAlternateLookup<TAlternateKey>(out System.Collections.Concurrent.ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey> lookup) where TAlternateKey : allows ref struct;
member this.TryGetAlternateLookup : AlternateLookup -> bool
Public Function TryGetAlternateLookup(Of TAlternateKey) (ByRef lookup As ConcurrentDictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)) As Boolean

類型參數

TAlternateKey

用於查找的另一種金鑰。

參數

lookup
ConcurrentDictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

當方法返回 true時所建立的查詢實例,或是當方法回傳 false時不應使用的預設實例。

傳回

true如果能建立查詢;否則,。 false

備註

此實例必須使用一個實 IAlternateEqualityComparer<TAlternate,T> 作為 和 TAlternateKeyTKey的比較器。 如果沒有,方法會返回 false。

適用於