SortedDictionary<TKey, TValue>.ValueCollection.Enumerator.Current Property

Gets the element at the current position of the enumerator.

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

public TValue Current { get; }

Property Value

Type: TValue
The element in the SortedDictionary<TKey, TValue>.ValueCollection at the current position of the enumerator.

Implements

IEnumerator<T>.Current

The Current property is undefined under any of the following conditions:

  • The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. The MoveNext method must be called to advance the enumerator to the first element of the collection before reading the value of Current.

  • The last call to MoveNext returned false, which indicates the end of the collection.

The Current property returns the same object until MoveNext is called. MoveNext sets Current to the next element. If the collection is modified between MoveNext and Current, Current returns the element that it is set to, even if the enumerator is already invalidated.

NoteNote

For better performance, this property does not throw an exception if the enumerator is positioned before the first element or after the last element; the value of the property is undefined.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft