Dictionary<TKey,TValue>.KeyCollection Konstruktor

Definicja

Inicjuje Dictionary<TKey,TValue>.KeyCollection nowe wystąpienie klasy, które odzwierciedla klucze w określonym Dictionary<TKey,TValue>obiekcie .

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

dictionary
Dictionary<TKey,TValue>

Klucze Dictionary<TKey,TValue> , których klucze są odzwierciedlone w nowym Dictionary<TKey,TValue>.KeyCollectionobiekcie .

Wyjątki

dictionary to null.

Uwagi

Element Dictionary<TKey,TValue>.KeyCollection nie jest kopią statyczną. Dictionary<TKey,TValue>.KeyCollection Zamiast tego element odwołuje się do kluczy w oryginalnym Dictionary<TKey,TValue>pliku . W związku z Dictionary<TKey,TValue> tym zmiany w obiekcie nadal będą odzwierciedlane w pliku Dictionary<TKey,TValue>.KeyCollection.

Ten konstruktor jest operacją O(1).

Dotyczy