Gets the element in the collection over which the current instance is positioned.
The element in the collection over which the current instance is positioned.
Type Reason InvalidOperationException The current instance is positioned before the first element or after the last element of the collection.
The collection was modified after the current instance was instantiated.
It is required that IEnumerator.Current return the element in the collection over which the current instance is positioned unless it is positioned before the first or after the last element of the collection. If the current instance is positioned before the first element or after the last element of the collection, IEnumerator.Current returns an unspecified value or throws an unspecified exception. If elements were added, removed, or repositioned in the collection after the current instance was instantiated, IEnumerator.Current returns the value it would have returned before the collection was modified.
It is also required that IEnumerator.Current not change the position of the current instance: consecutive calls to IEnumerator.Current are required to return the same object until either IEnumerator.MoveNext or IEnumerator.Reset is called.
This property is read-only.