Tablets.GetEnumerator - метод
Обновлен: Ноябрь 2007
Returns an object that implements the System.Collections.IEnumerator interface and that can iterate through the Tablet objects within the Tablets collection.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Function GetEnumerator As Tablets..::.TabletsEnumerator
'Применение
Dim instance As Tablets
Dim returnValue As Tablets..::.TabletsEnumerator
returnValue = instance.GetEnumerator()
public Tablets..::.TabletsEnumerator GetEnumerator()
public:
Tablets..::.TabletsEnumerator^ GetEnumerator()
public Tablets..::.TabletsEnumerator GetEnumerator()
public function GetEnumerator() : Tablets..::.TabletsEnumerator
Возвращаемое значение
Тип: Microsoft.Ink.Tablets.TabletsEnumerator
Returns an object that implements the IEnumerator interface and that can iterate through the Tablet objects within the Tablets collection.
Примеры
These examples show two ways to iterate over the Tablets collection, allTablets, and populate the ListBox object listBoxTablets with the names of each tablet device that is attached to the system.
This example gets the IEnumerator for the Tablets collection.
' Calling the constructor automatically fills the
' Tablets collection with the available Tablet objects.
Dim allTablets As Tablets = New Tablets()
' clear the list box
Me.listBoxTablets.Items.Clear()
' populate the list box with the name of each tablet
' version using GetEnumerator()
Dim theTabletsEnumerator As IEnumerator = allTablets.GetEnumerator()
While (theTabletsEnumerator.MoveNext())
Dim T As Tablet = theTabletsEnumerator.Current
Me.listBoxTablets.Items.Add(T.Name)
End While
// Calling the constructor automatically fills the
// Tablets collection with the available Tablet objects.
Tablets allTablets = new Tablets();
// clear the list box
this.listBoxTablets.Items.Clear();
// populate the list box with the name of each tablet
// version using GetEnumerator()
IEnumerator theTabletsEnumerator = allTablets.GetEnumerator();
while (theTabletsEnumerator.MoveNext())
{
Tablet T = (Tablet)theTabletsEnumerator.Current;
this.listBoxTablets.Items.Add(T.Name);
}
This example example uses the foreach statement, which calls the GetEnumerator method in internal code that the compiler generates to support the statement.
' Calling the constructor automatically fills the
' Tablets collection with the available Tablet objects.
Dim allTablets As Tablets = New Tablets()
' clear the list box
Me.listBoxTablets.Items.Clear()
' populate the list box with the name of each tablet
' version using For Each
For Each T As Tablet In allTablets
Me.listBoxTablets.Items.Add(T.Name)
Next
// Calling the constructor automatically fills the
// Tablets collection with the available Tablet objects.
Tablets allTablets = new Tablets();
// clear the list box
this.listBoxTablets.Items.Clear();
// populate the list box with the name of each tablet
// version using foreach
foreach (Tablet T in allTablets)
{
this.listBoxTablets.Items.Add(T.Name);
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0