Compartilhar via


CursorsEnumerator.Current Property

CursorsEnumerator.Current Property

Gets the Cursor object in the Cursors collection to which the enumerator is pointing.

Definition

Visual Basic .NET Public ReadOnly Property Current As Cursor
C# public Cursor Current { get; }
Managed C++ public: __property Cursor* get_Current();

Property Value

Microsoft.Ink.Cursor. The Cursor object in the Cursors collection to which the enumerator is pointing.

This property is read-only. This property has no default value.

Remarks

After a CursorsEnumerator enumerator is created, or after the Reset method is called, the MoveNext method must be called to advance the enumerator to the first element of the collection before reading the value of the Current property; otherwise, the Current property is undefined.

The Current property throws an exception if the last call to the MoveNext method returns false. If the last call to the MoveNext method returns false, the enumerator has reached the end of the Cursors collection.

The Current property does not move the position of the enumerator. Consecutive calls to the Current property return the same object until either the MoveNext or Reset method is called.

An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection—such as adding, modifying or deleting elements—the enumerator is irrecoverably invalidated. The next call to the MoveNext or Reset method throws an InvalidOperationException Leave Site exception. If the collection is modified between calling the MoveNext method and calling the Current property, the Current property returns the element that it is set to, even if the enumerator is already invalidated.

See Also