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


CustomStrokes.CustomStrokesEnumerator.MoveNext - метод

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

Moves the enumerator index to the next object in the collection.

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

Синтаксис

'Декларация
Public Function MoveNext As Boolean
'Применение
Dim instance As CustomStrokes..::.CustomStrokesEnumerator
Dim returnValue As Boolean

returnValue = instance.MoveNext()
public bool MoveNext()
public:
virtual bool MoveNext() sealed
public final boolean MoveNext()
public final function MoveNext() : boolean

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

Тип: System.Boolean
true if the index position references an object; false if the index position references the end of the collection.

Реализации

IEnumerator.MoveNext()

Заметки

The CustomStrokes.CustomStrokesEnumerator supports iterating over a CustomStrokes collection and implements the System.Collections.IEnumerator interface.

This method inherits from System.Collections.IEnumerator.MoveNext.

Примеры

These examples show two ways to enumerate the CustomStrokes collection in order to retrieve each Strokes object contained in the collection.

This example obtains the IEnumerator for the CustomStrokes collection, and uses it to traverse the collection. Each Strokes object is then scaled by a factor of 2.

Private Sub EnumerateCustomStrokesWithEnumerator(ByVal mInk As Ink)
    Dim mCustomStrokesEnumerator As IEnumerator = mInk.CustomStrokes.GetEnumerator()
    mCustomStrokesEnumerator.Reset()
    While (mCustomStrokesEnumerator.MoveNext())
        Dim S As Strokes = DirectCast(mCustomStrokesEnumerator.Current, Strokes)
        S.Scale(2, 2)
    End While
End Sub
private void EnumerateCustomStrokesWithEnumerator(Ink mInk)
{
    IEnumerator mCustomStrokesEnumerator = mInk.CustomStrokes.GetEnumerator();
    mCustomStrokesEnumerator.Reset();
    while (mCustomStrokesEnumerator.MoveNext())
    {
        Strokes S = (Strokes)mCustomStrokesEnumerator.Current;
        S.Scale(2, 2);
    }
}

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

Private Sub EnumerateCustomStrokesWithForEach(ByVal mInk As Ink)
    For Each S As Strokes In mInk.CustomStrokes
        S.Scale(2, 2)
    Next
End Sub
private void EnumerateCustomStrokesWithForEach(Ink mInk)
{
    foreach (Strokes S in mInk.CustomStrokes)
    {
        S.Scale(2, 2);
    }

}

Платформы

Windows Vista

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

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

.NET Framework

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

См. также

Ссылки

CustomStrokes.CustomStrokesEnumerator Класс

CustomStrokes.CustomStrokesEnumerator - члены

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

CustomStrokes