Dictionary(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 Dictionary(Of TKey, TValue).KeyCollection class that reflects the keys in the specified Dictionary(Of TKey, TValue).
Assembly: mscorlib (in mscorlib.dll)
Parameters
- dictionary
- Type: System.Collections.Generic.Dictionary(Of TKey, TValue)
The Dictionary(Of TKey, TValue) whose keys are reflected in the new Dictionary(Of TKey, TValue).KeyCollection.
| Exception | Condition |
|---|---|
| ArgumentNullException | dictionary is Nothing. |
The Dictionary(Of TKey, TValue).KeyCollection is not a static copy; instead, the Dictionary(Of TKey, TValue).KeyCollection refers back to the keys in the original Dictionary(Of TKey, TValue). Therefore, changes to the Dictionary(Of TKey, TValue) continue to be reflected in the Dictionary(Of TKey, TValue).KeyCollection.
This constructor is an O(1) operation.