Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> 結構

定義

提供一種類型,可用來使用 Dictionary<TKey,TValue> 做為索引鍵,而不是使用 TAlternateKey,在 TKey 上執行作業。

public: generic <typename TAlternateKey>
value class Dictionary<TKey, TValue>::AlternateLookup
public readonly struct Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> where TAlternateKey : allows ref struct
type Dictionary<'Key, 'Value>.AlternateLookup<'AlternateKey> = struct
Public Structure Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey)

類型參數

TKey

字典中索引鍵的類型。

TValue

字典中值的型別。

TAlternateKey

用於查找的另一種金鑰。

繼承
Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

屬性

名稱 Description
Dictionary

取得 Dictionary<TKey,TValue> 該實例執行操作的對應點。

Item[TAlternateKey]

取得或設定與指定替代鍵相關聯的值。

方法

名稱 Description
ContainsKey(TAlternateKey)

判斷是否 Dictionary<TKey,TValue> 包含指定的替代鍵。

Remove(TAlternateKey, TKey, TValue)

從 中移除指定替代鍵 Dictionary<TKey,TValue>的值,並將該元素複製到值參數。

Remove(TAlternateKey)

從 中移除指定替代鍵 Dictionary<TKey,TValue>的值。

TryAdd(TAlternateKey, TValue)

嘗試將指定的索引鍵和值新增至字典。

TryGetValue(TAlternateKey, TKey, TValue)

取得與指定替代鍵相關的值。

TryGetValue(TAlternateKey, TValue)

取得與指定替代鍵相關的值。

適用於