SortedDictionary<TKey,TValue>.KeyCollection Konstruktor

Definition

Initierar en ny instans av SortedDictionary<TKey,TValue>.KeyCollection klassen som återspeglar nycklarna i den angivna SortedDictionary<TKey,TValue>.

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

Parametrar

Undantag

dictionary är null.

Kommentarer

SortedDictionary<TKey,TValue>.KeyCollection är inte en statisk kopia. I stället SortedDictionary<TKey,TValue>.KeyCollection refererar den tillbaka till nycklarna i den ursprungliga SortedDictionary<TKey,TValue>. Därför fortsätter ändringarna att SortedDictionary<TKey,TValue> återspeglas i SortedDictionary<TKey,TValue>.KeyCollection.

Den här konstruktorn är en O(1)-åtgärd.

Gäller för