TX Text Control .NET Server

GetEnumerator Method

Method
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 DocumentTargetCollection.DocumentTargetEnumerator GetEnumerator();

Return Value

The return value is an IEnumerator that represents the collection.

Examples

The following example works with document targets in the current document by using DocumentTargetCollection.GetEnumerator.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentTargetCollection documentTargetCollection = textControl.DocumentTargets;
documentTargetCollection.Add(new DocumentTarget("CustomerDetails") { ID = 100 });

IEnumerator enumerator = documentTargetCollection.GetEnumerator();

while (enumerator.MoveNext())
{
    DocumentTarget documentTarget = (DocumentTarget)enumerator.Current;
    Console.WriteLine(documentTarget);
}