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

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

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

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

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

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft