AnalysisWarningCollection.GetEnumerator Method

Returns an object that implements the IEnumerator interface and that can iterate through the AnalysisWarning objects within the AnalysisWarningCollection.

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)

Syntax

'Declaration
Public Function GetEnumerator As AnalysisWarningCollectionEnumerator
'Usage
Dim instance As AnalysisWarningCollection
Dim returnValue As AnalysisWarningCollectionEnumerator

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

Return Value

Returns an object that implements the IEnumerator interface and that can iterate through the AnalysisWarning objects within the AnalysisWarningCollection.

Example

The examples in this section show two ways to iterate through an AnalysisWarningCollection and get the AnalysisHintNode objects for each AnalysisWarning object.

The following example gets the IEnumerator for the AnalysisWarningCollection, warnings.

Dim hints As New ArrayList()
' Version using GetEnumerator()
Dim ienum As IEnumerator = warnings.GetEnumerator()
While ienum.MoveNext()
    Dim hint As AnalysisHintNode = CType(ienum.Current, AnalysisWarning).AnalysisHint
    hints.Add(hint)
End While
ArrayList hints = new ArrayList();
// Version using GetEnumerator()
IEnumerator ienum = warnings.GetEnumerator();
while (ienum.MoveNext())
{
    AnalysisHintNode hint = ((AnalysisWarning)ienum.Current).AnalysisHint;
    hints.Add(hint);
}

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

' Version using foreach
For Each warning As AnalysisWarning In warnings
    Dim hint As AnalysisHintNode = warning.AnalysisHint
    hints.Add(hint)
Next warning
// Version using foreach
foreach (AnalysisWarning warning in warnings)
{
    AnalysisHintNode hint = warning.AnalysisHint;
    hints.Add(hint);
}

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

AnalysisWarningCollection Class
AnalysisWarningCollection Members
System.Windows.Ink Namespace
AnalysisWarning