SortedDictionary(Of TKey, TValue).KeyCollection Constructor
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the SortedDictionary(Of TKey, TValue).KeyCollection class that reflects the keys in the specified SortedDictionary(Of TKey, TValue).
Assembly: System (in System.dll)
Parameters
- dictionary
- Type: System.Collections.Generic.SortedDictionary(Of TKey, TValue)
The SortedDictionary(Of TKey, TValue) whose keys are reflected in the new SortedDictionary(Of TKey, TValue).KeyCollection.
| Exception | Condition |
|---|---|
| ArgumentNullException | dictionary is Nothing. |
The SortedDictionary(Of TKey, TValue).KeyCollection is not a static copy; instead, the SortedDictionary(Of TKey, TValue).KeyCollection refers back to the keys in the original SortedDictionary(Of TKey, TValue). Therefore, changes to the SortedDictionary(Of TKey, TValue) continue to be reflected in the SortedDictionary(Of TKey, TValue).KeyCollection.
This constructor is an O(1) operation.