Share via


ContextLinkBaseCollection.GetEnumerator Method

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

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Function GetEnumerator As ContextLinkBaseCollection.ContextLinkBaseCollectionEnumerator
'Usage
Dim instance As ContextLinkBaseCollection 
Dim returnValue As ContextLinkBaseCollection.ContextLinkBaseCollectionEnumerator 

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

Return Value

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

Examples

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.
}

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ContextLinkBaseCollection Class

ContextLinkBaseCollection Members

System.Windows.Ink.AnalysisCore Namespace