Dictionary<TKey,TValue>.KeyCollection Constructeur

Définition

Initialise une nouvelle instance de la Dictionary<TKey,TValue>.KeyCollection classe qui reflète les clés dans le fichier spécifié 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))

Paramètres

dictionary
Dictionary<TKey,TValue>

Dont Dictionary<TKey,TValue> les clés sont reflétées dans le nouveau Dictionary<TKey,TValue>.KeyCollection.

Exceptions

dictionary a la valeur null.

Remarques

Il Dictionary<TKey,TValue>.KeyCollection ne s’agit pas d’une copie statique ; à la place, le Dictionary<TKey,TValue>.KeyCollection fait référence aux clés dans l’original Dictionary<TKey,TValue>. Par conséquent, les modifications apportées à la Dictionary<TKey,TValue> continue à être reflétées dans le Dictionary<TKey,TValue>.KeyCollection.

Ce constructeur est une opération O(1).

S’applique à