Share via


Tablets.GetEnumerator Method

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

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Function GetEnumerator As TabletsEnumerator
'Usage
Dim instance As Tablets
Dim returnValue As TabletsEnumerator

returnValue = instance.GetEnumerator
public TabletsEnumerator GetEnumerator ()
public:
TabletsEnumerator^ GetEnumerator ()
public TabletsEnumerator GetEnumerator ()
public function GetEnumerator () : TabletsEnumerator
Not applicable.

Return Value

Returns an object that implements the IEnumerator interface and that can iterate through the Tablet objects within the Tablets collection.

Example

These C# examples show two ways to iterate over the Tablets collection, theTablets, and get the name for each Tablet object in theTablets.

This C# example gets the IEnumerator for the Tablets collection.

ArrayList theArrayList = new ArrayList();
// Version using GetEnumerator()
IEnumerator theTabletsEnumerator = theTablets.GetEnumerator();
while (theTabletsEnumerator.MoveNext())
{
    Tablet theTablet = (Tablet) theTabletsEnumerator.Current;
    theArrayList.Add(theTablet.Name)
}

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

ArrayList theArrayList = new ArrayList();
// Version using foreach
foreach (Tablet theTablet in theTablets)
{
    theArrayList.Add(theTablet.Name);
}

These Microsoft® Visual Basic® .NET examples show two ways to iterate over the Tablets collection, theTablets, and get the name for each Tablet object in theTablets.

This Visual Basic .NET example gets the IEnumerator for the Tablets collection.

Dim theArrayList As New ArrayList()
Dim theTablet as Tablet
'Version using GetEnumerator()
Dim theTabletsEnumerator as IEnumerator = theTablets.GetEnumerator()
While (theTabletsEnumerator.MoveNext())
    theTablet = theTabletsEnumerator.Current
    theArrayList.Add(theTablet.Name)
End While

This Visual Basic .NET example uses the For Each statement, which calls the GetEnumerator method in internal code that the compiler generates to support the statement.

Dim theArrayList As New ArrayList()
Dim theTablet As Tablet
'Version using For Each
For Each theTablet In theTablets
    theArrayList.Add(theTablet.Name)
Next

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

Tablets Class
Tablets Members
Microsoft.Ink Namespace
Tablet