NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

IEnumerator.Current

When implemented by a class, gets the current element in the collection.

[Visual Basic]
ReadOnly Property Current As Object
[C#]
object Current {get;}
[C++]
Object* get_Current() = 0;
[JScript]
abstract function get Current() : Object;

Property Value

The current element in the collection.

Exceptions

Exception Type Condition
InvalidOperationException The enumerator is positioned before the first element of the collection or after the last element.

-or-

The collection was modified after the enumerator was instantiated.

Remarks

After an enumerator is created or after a Reset, MoveNext must be called to advance the enumerator to the first element of the collection before reading the value of Current. Otherwise, Current is undefined.

Current will also throw an exception if the last call to MoveNext returned false which indicates the end of the collection.

Current does not move the position of the enumerator and consecutive calls to Current will return the same object until either MoveNext or Reset is called.

See Also

IEnumerator Interface | IEnumerator Members | System.Collections Namespace | MoveNext | Reset