Dictionary<TKey,TValue>.KeyCollection(Dictionary<TKey,TValue>) Konstruktor

Definicja

Inicjuje nowe wystąpienie Dictionary<TKey,TValue>.KeyCollection klasy, która odzwierciedla klucze w określonym Dictionary<TKey,TValue> .Initializes a new instance of the Dictionary<TKey,TValue>.KeyCollection class that reflects the keys in the specified 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

dictionary
Dictionary<TKey,TValue>

Które Dictionary<TKey,TValue> klucze są odzwierciedlone w nowym Dictionary<TKey,TValue>.KeyCollection .The Dictionary<TKey,TValue> whose keys are reflected in the new Dictionary<TKey,TValue>.KeyCollection.

Wyjątki

dictionary to null.dictionary is null.

Uwagi

Dictionary<TKey,TValue>.KeyCollectionNie jest to kopia statyczna; zamiast tego Dictionary<TKey,TValue>.KeyCollection odwołuje się do kluczy w oryginalnym Dictionary<TKey,TValue> .The Dictionary<TKey,TValue>.KeyCollection is not a static copy; instead, the Dictionary<TKey,TValue>.KeyCollection refers back to the keys in the original Dictionary<TKey,TValue>. W związku z tym zmiany w Dictionary<TKey,TValue> dalszym ciągu zostaną odzwierciedlone w Dictionary<TKey,TValue>.KeyCollection .Therefore, changes to the Dictionary<TKey,TValue> continue to be reflected in the Dictionary<TKey,TValue>.KeyCollection.

Ten konstruktor jest operacją O (1).This constructor is an O(1) operation.

Dotyczy