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 DocumentTargetCollection.DocumentTargetEnumerator GetEnumerator();Public Function GetEnumerator() As DocumentTargetCollection.DocumentTargetEnumeratorReturn 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);
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentTargetCollection As DocumentTargetCollection = textControl.DocumentTargets
documentTargetCollection.Add(New DocumentTarget("CustomerDetails") With { .ID = 100 })
Dim enumerator As IEnumerator = documentTargetCollection.GetEnumerator()
While enumerator.MoveNext()
Dim documentTarget As DocumentTarget =
DirectCast(enumerator.Current, DocumentTarget)
Console.WriteLine(documentTarget)
End While