Dictionary<TKey,TValue>.KeyCollection Konstruktor

Definice

Inicializuje novou instanci Dictionary<TKey,TValue>.KeyCollection třídy, která odráží klíče v zadané Dictionary<TKey,TValue>.

public:
 KeyCollection(System::Collections::Generic::Dictionary<TKey, TValue> ^ dictionary);
public KeyCollection (System.Collections.Generic.Dictionary<TKey,TValue> dictionary);
new System.Collections.Generic.Dictionary<'Key, 'Value>.KeyCollection : System.Collections.Generic.Dictionary<'Key, 'Value> -> System.Collections.Generic.Dictionary<'Key, 'Value>.KeyCollection
Public Sub New (dictionary As Dictionary(Of TKey, TValue))

Parametry

Výjimky

dictionary je null.

Poznámky

Nejedná se Dictionary<TKey,TValue>.KeyCollection o statickou kopii, Dictionary<TKey,TValue>.KeyCollection ale odkazuje zpět na klíče v původním Dictionary<TKey,TValue>souboru . Proto se Dictionary<TKey,TValue> změny v souboru i nadále promítnou do Dictionary<TKey,TValue>.KeyCollection.

Tento konstruktor je operace O(1).

Platí pro