TX Text Control .NET Server

GetEnumerator Method

Method|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Returns an enumerator that can be used to iterate through the collection.

Syntax

public LineCollection.LineEnumerator GetEnumerator();

Return Value

The return value is an IEnumerator that represents the collection.

Examples

The following example works with lines in the current document by using LineCollection.GetEnumerator.

LineCollection lineCollection = textControl.Lines;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";

IEnumerator enumerator = lineCollection.GetEnumerator();

while (enumerator.MoveNext())
{
    Line line = (Line)enumerator.Current;
    Console.WriteLine(line);
}