Sdílet prostřednictvím


AnalysisWarningBaseCollection.GetEnumerator Method

Returns an object that implements the IEnumerator interface and that can iterate through the AnalysisWarningBase objects within AnalysisWarningBaseCollection.

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

Syntax

'Declaration
Public Function GetEnumerator As AnalysisWarningBaseCollection.AnalysisWarningBaseCollectionEnumerator
'Usage
Dim instance As AnalysisWarningBaseCollection 
Dim returnValue As AnalysisWarningBaseCollection.AnalysisWarningBaseCollectionEnumerator 

returnValue = instance.GetEnumerator()
public AnalysisWarningBaseCollection.AnalysisWarningBaseCollectionEnumerator GetEnumerator()
public:
AnalysisWarningBaseCollection.AnalysisWarningBaseCollectionEnumerator^ GetEnumerator()
public function GetEnumerator() : AnalysisWarningBaseCollection.AnalysisWarningBaseCollectionEnumerator

Return Value

Type: System.Windows.Ink.AnalysisCore.AnalysisWarningBaseCollection.AnalysisWarningBaseCollectionEnumerator
Returns an object that implements the IEnumerator interface and that can iterate through the AnalysisWarningBase objects within AnalysisWarningBaseCollection.

Examples

The examples in this section show two ways to iterate over an AnalysisWarningBaseCollection and get the AnalysisHintNode objects for each AnalysisWarningBase.

The following example gets the IEnumerator for the AnalysisWarningBaseCollection named warnings.

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

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

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

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

AnalysisWarningBaseCollection Class

AnalysisWarningBaseCollection Members

System.Windows.Ink.AnalysisCore Namespace