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


ContextLinkBaseCollection.GetEnumerator - метод

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

Returns an object that implements the IEnumerator interface and can iterate through the ContextLinkBase objects within the ContextLinkBaseCollection.

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

Синтаксис

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

returnValue = instance.GetEnumerator()
public ContextLinkBaseCollection..::.ContextLinkBaseCollectionEnumerator GetEnumerator()
public:
ContextLinkBaseCollection..::.ContextLinkBaseCollectionEnumerator^ GetEnumerator()
public ContextLinkBaseCollection..::.ContextLinkBaseCollectionEnumerator GetEnumerator()
public function GetEnumerator() : ContextLinkBaseCollection..::.ContextLinkBaseCollectionEnumerator

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

Тип: System.Windows.Ink.AnalysisCore.ContextLinkBaseCollection.ContextLinkBaseCollectionEnumerator
An object that implements the IEnumerator interface and can iterate through the ContextLinkBase objects within the ContextLinkBaseCollection.

Примеры

The examples in this section show two ways to iterate over a ContextLinkBaseCollection named links, collecting all of the custom links.

The following example gets the IEnumerator for the ContextLinkBaseCollection named links.

Dim customLinks As New ArrayList()
' Version using GetEnumerator()
Dim enumerator As _
    ContextLinkBaseCollection.ContextLinkBaseCollectionEnumerator = links.GetEnumerator()
While enumerator.MoveNext()
    Dim aLink As ContextLinkBase = CType(enumerator.Current, ContextLinkBase)
    ' Perform some action with each ContextLinkBase.

End While
ArrayList customLinks = new ArrayList();
// Version using GetEnumerator()
ContextLinkBaseCollection.ContextLinkBaseCollectionEnumerator
    enumerator = links.GetEnumerator();
while (enumerator.MoveNext())
{
    ContextLinkBase link =
        ((ContextLinkBase)enumerator.Current);

    // Perform some action with each ContextLinkBase.
}

The following example uses the foreach statement, which calls the GetEnumerator method in internal code generated by the compiler in support of the statement.

' Version using foreach
Dim link As ContextLinkBase
For Each link In links
    ' Perform some action with each ContextLinkBase.
Next link
// Version using foreach
foreach (ContextLinkBase link in links)
{
    // Perform some action with each ContextLink.
}

Платформы

Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows Server 2003

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

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

.NET Framework

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

См. также

Ссылки

ContextLinkBaseCollection Класс

ContextLinkBaseCollection - члены

System.Windows.Ink.AnalysisCore - пространство имен