Dictionary<TKey,TValue>.KeyCollection Constructor

Definitie

Initialiseert een nieuw exemplaar van de Dictionary<TKey,TValue>.KeyCollection klasse die de sleutels in de opgegeven Dictionary<TKey,TValue>klasse weerspiegelt.

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))

Parameters

dictionary
Dictionary<TKey,TValue>

De Dictionary<TKey,TValue> wiens sleutels worden weerspiegeld in de nieuwe Dictionary<TKey,TValue>.KeyCollection.

Uitzonderingen

dictionary is null.

Opmerkingen

Het Dictionary<TKey,TValue>.KeyCollection is geen statische kopie; in plaats daarvan verwijst de Dictionary<TKey,TValue>.KeyCollection waarde terug naar de sleutels in het origineel Dictionary<TKey,TValue>. Daarom blijven wijzigingen in de wijzigingen in de Dictionary<TKey,TValue>Dictionary<TKey,TValue>.KeyCollection.

Deze constructor is een O(1)-bewerking.

Van toepassing op