AnalysisWarningCollection.GetEnumerator - метод
Обновлен: Ноябрь 2007
Returns an object that implements the IEnumerator interface and that can iterate through the AnalysisWarning objects within the AnalysisWarningCollection.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.dll)
Синтаксис
'Декларация
Public Function GetEnumerator As AnalysisWarningCollection..::.AnalysisWarningCollectionEnumerator
'Применение
Dim instance As AnalysisWarningCollection
Dim returnValue As AnalysisWarningCollection..::.AnalysisWarningCollectionEnumerator
returnValue = instance.GetEnumerator()
public AnalysisWarningCollection..::.AnalysisWarningCollectionEnumerator GetEnumerator()
public:
AnalysisWarningCollection..::.AnalysisWarningCollectionEnumerator^ GetEnumerator()
public AnalysisWarningCollection..::.AnalysisWarningCollectionEnumerator GetEnumerator()
public function GetEnumerator() : AnalysisWarningCollection..::.AnalysisWarningCollectionEnumerator
Возвращаемое значение
Тип: Microsoft.Ink.AnalysisWarningCollection.AnalysisWarningCollectionEnumerator
Returns an object that implements the IEnumerator interface and that can iterate through the AnalysisWarning objects within the AnalysisWarningCollection.
Примеры
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
Dim warning As AnalysisWarning
For Each warning 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);
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0
См. также
Ссылки
AnalysisWarningCollection Класс
AnalysisWarningCollection - члены