SortedDictionary<TKey,TValue>.KeyCollection Konstruktor
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
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
- dictionary
- SortedDictionary<TKey,TValue>
Vars SortedDictionary<TKey,TValue> nycklar återspeglas i den nya SortedDictionary<TKey,TValue>.KeyCollection.
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.