Поделиться через


Cursors.GetEnumerator - метод

Обновлен: Ноябрь 2007

Returns an object that implements the System.Collections.IEnumerator interface and that can iterate through the Cursor objects within the Cursors collection.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Function GetEnumerator As Cursors..::.CursorsEnumerator
'Применение
Dim instance As Cursors
Dim returnValue As Cursors..::.CursorsEnumerator

returnValue = instance.GetEnumerator()
public Cursors..::.CursorsEnumerator GetEnumerator()
public:
Cursors..::.CursorsEnumerator^ GetEnumerator()
public Cursors..::.CursorsEnumerator GetEnumerator()
public function GetEnumerator() : Cursors..::.CursorsEnumerator

Возвращаемое значение

Тип: Microsoft.Ink.Cursors.CursorsEnumerator
Returns an object that implements the System.Collections.IEnumerator interface and that can iterate through the Cursor objects within the Cursors collection.

Примеры

These examples show two ways to iterate over the Cursors collection and get the name for each Cursor object included in the collection. The Cursors collection is returned by the InkOverlay.Cursors property.

In this example, the System.Collections.IEnumerator is obtained for the Cursors collection, and used to enumerate each item of the collection.

Dim names As ArrayList = New ArrayList()
Dim ienum As IEnumerator = mInkOverlay.Cursors.GetEnumerator()
ienum.Reset()
While ienum.MoveNext()
    Dim theCursor As Microsoft.Ink.Cursor = DirectCast(ienum.Current, Microsoft.Ink.Cursor)
    names.Add(theCursor.Name)
End While
ArrayList names = new ArrayList();
IEnumerator ienum = mInkOverlay.Cursors.GetEnumerator();
ienum.Reset();
while (ienum.MoveNext())
{
    Microsoft.Ink.Cursor theCursor = (Microsoft.Ink.Cursor)ienum.Current;
    names.Add(theCursor.Name);
}

This example uses the foreach statement, which calls the GetEnumerator method in internal code that the compiler generates to support the statement.

Dim names As ArrayList = New ArrayList()
For Each theCursor As Microsoft.Ink.Cursor In mInkOverlay.Cursors
    names.Add(theCursor.Name)
Next
ArrayList names = new ArrayList();
foreach (Microsoft.Ink.Cursor theCursor in mInkOverlay.Cursors)
{
    names.Add(theCursor.Name);
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Cursors Класс

Cursors - члены

Microsoft.Ink - пространство имен

Cursor

InkCollector.Cursors