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 ParagraphCollection.ParagraphEnumerator GetEnumerator();Public Function GetEnumerator() As ParagraphCollection.ParagraphEnumeratorReturn Value
The return value is an IEnumerator that represents the collection.
Examples
The following example works with paragraphs in the current document by using ParagraphCollection.GetEnumerator.
ParagraphCollection paragraphCollection = textControl.Paragraphs;
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
IEnumerator enumerator = paragraphCollection.GetEnumerator();
while (enumerator.MoveNext())
{
Paragraph paragraph = (Paragraph)enumerator.Current;
Console.WriteLine(paragraph);
}Dim paragraphCollection As ParagraphCollection = textControl.Paragraphs
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
Dim enumerator As IEnumerator = paragraphCollection.GetEnumerator()
While enumerator.MoveNext()
Dim paragraph As Paragraph =
DirectCast(enumerator.Current, Paragraph)
Console.WriteLine(paragraph)
End While