SortedDictionary<TKey,TValue>.KeyCollection 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化一個反映指定SortedDictionary<TKey,TValue>.KeyCollection鍵數的類別新實例SortedDictionary<TKey,TValue>。
public:
KeyCollection(System::Collections::Generic::SortedDictionary<TKey, TValue> ^ dictionary);
public KeyCollection(System.Collections.Generic.SortedDictionary<TKey,TValue> dictionary);
new System.Collections.Generic.SortedDictionary<'Key, 'Value>.KeyCollection : System.Collections.Generic.SortedDictionary<'Key, 'Value> -> System.Collections.Generic.SortedDictionary<'Key, 'Value>.KeyCollection
Public Sub New (dictionary As SortedDictionary(Of TKey, TValue))
參數
- dictionary
- SortedDictionary<TKey,TValue>
其 SortedDictionary<TKey,TValue> 鍵在新的 SortedDictionary<TKey,TValue>.KeyCollection中被反映。
例外狀況
dictionary 是 null。
備註
這 SortedDictionary<TKey,TValue>.KeyCollection 不是靜態複製品;而是 SortedDictionary<TKey,TValue>.KeyCollection 回溯到原始 SortedDictionary<TKey,TValue>鍵。 因此,變化 SortedDictionary<TKey,TValue> 會持續反映在 SortedDictionary<TKey,TValue>.KeyCollection中。
此構造子為 O(1) 運算。