語言

Dictionary<TKey,TValue>.GetAlternateLookup<TAlternateKey> 方法

定義

獲得一個型 Dictionary<TKey,TValue> 態的實例,可用 a TAlternateKey 作為鍵而非 TKey。

public:
generic <typename TAlternateKey>
 System::Collections::Generic::Dictionary<TKey, TValue>::AlternateLookup<TAlternateKey> GetAlternateLookup();
public System.Collections.Generic.Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> GetAlternateLookup<TAlternateKey>() where TAlternateKey : allows ref struct;
member this.GetAlternateLookup : unit -> System.Collections.Generic.Dictionary<'Key, 'Value>.AlternateLookup<'AlternateKey>
Public Function GetAlternateLookup(Of TAlternateKey) () As Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)

類型參數

TAlternateKey

用於查找的另一種金鑰。

傳回

建立的查詢實例。

例外狀況

字典的比較器與 不相容 TAlternateKey。

備註

字典必須使用一個比較 IAlternateEqualityComparer<TAlternate,T> 器,實現 與 TAlternateKeyTKey。 如果沒有,就會拋出例外。

適用於