GetEnumerator Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Returns an enumerator that can be used to iterate through the collection.
Syntax
public CommentCollection.CommentedTextEnumerator GetEnumerator();Public Function GetEnumerator() As CommentCollection.CommentedTextEnumeratorReturn Value
The return value is an IEnumerator that represents the collection.
Examples
The following example works with comments in the current document by using CommentCollection.GetEnumerator.
CommentCollection commentCollection = textControl.Comments;
textControl.Text = "Payment is due within 30 days.";
textControl.Select(0, textControl.Text.Length);
commentCollection.Add(new CommentedText("Verify the payment term."));
IEnumerator enumerator = commentCollection.GetEnumerator();
while (enumerator.MoveNext())
{
CommentedText commentedText = (CommentedText)enumerator.Current;
Console.WriteLine(commentedText);
}Dim commentCollection As CommentCollection = textControl.Comments
textControl.Text = "Payment is due within 30 days."
textControl.Select(0, textControl.Text.Length)
commentCollection.Add(New CommentedText("Verify the payment term."))
Dim enumerator As IEnumerator = commentCollection.GetEnumerator()
While enumerator.MoveNext()
Dim commentedText As CommentedText =
DirectCast(enumerator.Current, CommentedText)
Console.WriteLine(commentedText)
End While