Dictionary(TKey, TValue).KeyCollection Constructor
Collapse the table of content
Expand the table of content

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

Namespace:  System.Collections.Generic
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Sub New ( _
	dictionary As Dictionary(Of TKey, TValue) _
)

ExceptionCondition
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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft