TX Text Control .NET Server

Clear Method

Method|Introduced in 13.0
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

Removes all document targets from a Text Control document.

Syntax

public void Clear();

Examples

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

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

if (documentTargetCollection.Count > 0)
{
    documentTargetCollection.Clear();
}