GetEnumerator Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Returns an enumerator that can be used to iterate through the collection.
Syntax
public SectionCollection.SectionEnumerator GetEnumerator();Public Function GetEnumerator() As SectionCollection.SectionEnumeratorReturn Value
The return value is an IEnumerator that represents the collection.
Examples
The following example works with sections in the current document by using SectionCollection.GetEnumerator.
SectionCollection sectionCollection = textControl.Sections;
sectionCollection.Add(SectionBreakKind.BeginAtNewPage, -1);
IEnumerator enumerator = sectionCollection.GetEnumerator();
while (enumerator.MoveNext())
{
Section section = (Section)enumerator.Current;
Console.WriteLine(section);
}Dim sectionCollection As SectionCollection = textControl.Sections
sectionCollection.Add(SectionBreakKind.BeginAtNewPage, -1)
Dim enumerator As IEnumerator = sectionCollection.GetEnumerator()
While enumerator.MoveNext()
Dim section As Section =
DirectCast(enumerator.Current, Section)
Console.WriteLine(section)
End While