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 LineCollection.LineEnumerator GetEnumerator();Public Function GetEnumerator() As LineCollection.LineEnumeratorReturn 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);
}Dim lineCollection As LineCollection = textControl.Lines
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
Dim enumerator As IEnumerator = lineCollection.GetEnumerator()
While enumerator.MoveNext()
Dim line As Line =
DirectCast(enumerator.Current, Line)
Console.WriteLine(line)
End While