Remove 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
Removes a table of contents from the collection including all its text and including all DocumentTargets to where the table's links point.
Syntax
public bool Remove(TableOfContents tableOfContent);Public Function Remove(tableOfContent As TableOfContents) As BooleanParameters
| Parameter | Description |
|---|---|
| tableOfContent | Specifies the table of contents to remove. |
Return Value
The return value is true, if the table of contents could be removed. Otherwise, it is false.
Examples
The following example works with tables of contents in the current document by using TableOfContentsCollection.Remove.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
TableOfContentsCollection tableOfContentsCollection = textControl.TablesOfContents;
tableOfContentsCollection.Add(new TableOfContents(1, 3) { Name = "Contents", ID = 100 });
if (tableOfContentsCollection.Count > 0)
{
TableOfContents tableOfContents = tableOfContentsCollection[1];
if (tableOfContentsCollection.Remove(tableOfContents))
{
Console.WriteLine("The item was removed.");
}
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim tableOfContentsCollection As TableOfContentsCollection = textControl.TablesOfContents
tableOfContentsCollection.Add(New TableOfContents(1, 3) With { .Name = "Contents", .ID = 100 })
If tableOfContentsCollection.Count > 0 Then
Dim tableOfContents As TableOfContents = tableOfContentsCollection.Item(1)
If tableOfContentsCollection.Remove(tableOfContents) Then
Console.WriteLine("The item was removed.")
End If
End If