TableOfContents Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. Core. SDK
- Assembly
TXTextControl.Core. dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. Core. SDK TXTextControl.from the setup.dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
A TableOfContents object defines the position and the properties of a table of contents. A table of contents can be automatically genarated from the structure levels defined for each paragraph in the document. A document can contain multiple tables of contents consisting of paragraphs with different levels. All tables of contents in a document are available through a TableOfContentsCollection object. To generate a new table of contents the TableOfContentsCollection.Add method can be used.
Syntax
public class TableOfContentsPublic Class TableOfContentsExamples
The following example creates a table of contents for the document's heading styles.
TableOfContents tableOfContents = new(1, 3) { Name = "Contents", ID = 10 };
textControl.TablesOfContents.Add(tableOfContents);Dim tableOfContents As New TableOfContents(1, 3) With { .Name = "Contents", .ID = 10 }
textControl.TablesOfContents.Add(tableOfContents)Members
Constructors
| Constructor | Description |
|---|---|
| TableOfContents | Initializes a new instance of the TableOfContents class. |
Properties
| Property | Description |
|---|---|
| DefaultHighlightColor | Represents the default highlight color. It is black with an alpha value of 60. |
| HasLinks | Gets or sets a value specifying whether each entry in the table of contents is a DocumentLink with a corresponding DocumentTarget. When the end-user clicks on the link while pressing the CTRL-key, the document is scrolled to the paragraph in the document that belongs to the entry in the table of contents. |
| HasPageNumbers | Gets or sets a value specifying whether the table of contents contains page numbers. |
| HasRightAlignedPageNumbers | Gets or sets a value specifying whether the page numbers in the table of contents are right-aligned. To realize right-aligned page numbers a tab is inserted and its TabType is set to RightBorderTab. |
| HighlightColor | Gets or sets the highlight color for the table of contents. Depending on the HighlightMode a table of contents is highlighted, if it contains the current text input position, is always highlighted or never. The color's alpha value must be less than 255 (opaque) so that the text remains visible. The default value is black with an alpha value of 60. |
| HighlightMode | Gets or sets a value indicating how the text of the table of contents is highlighted. |
| ID | Gets or sets an identifier. It must be a one-based value. A value of zero indicates that the table of contents has no identifier. |
| Length | Gets the number of characters which belong to the table of contents. |
| MaximumStructureLevel | Gets or sets the maximum structure level for this table of contents. The table of contents contains all paragraphs with a structure level less than or equal this value. It must be between 1 and 10. |
| MinimumStructureLevel | Gets or sets the minimum structure level for this table of contents. The table of contents contains all paragraphs with a structure level larger than or equal this value. It must be between 1 and 10. |
| Name | Gets or sets a name for the table of contents. An empty string indicates that the table of contents has no name. |
| Number | Gets the number of the table of contents in the text. The first table of contents has the number 1. The number is defined through the textflow. A table of contents with a smaller start position has a smaller number. |
| Start | Gets the index (one-based) of the first character which belongs to the table of contents. |
| Text | Gets the text of the table of contents. |
| Title | Gets or sets a title for the table of contents. An empty string indicates that the table of contents has no title. |