DocumentLinkCollection 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
- Inherits
- Text
Field Collection Base - Document
Link Collection
- Text
- Implements
- ICollection, IEnumerable
Description
An instance of the DocumentLinkCollection class contains all links in a Text Control document that point to targets in the same document. An instance of this class can be obtained with the TextControl.DocumentLinks property. The DocumentLinkCollection class implements the IEnumerable and the ICollection interfaces. Document links are represented through the DocumentLink class. For more information see the technical article Text Fields and Hypertext Links.
Syntax
public sealed class DocumentLinkCollection : TextFieldCollectionBasePublic NotInheritable Class DocumentLinkCollection
Inherits TextFieldCollectionBaseExamples
The following example works with document links in the current document.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentLinkCollection documentLinkCollection = textControl.DocumentLinks;
DocumentTarget target = new("CustomerDetails");
textControl.DocumentTargets.Add(target);
documentLinkCollection.Add(new DocumentLink("View customer details", target) { ID = 100 });textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentLinkCollection As DocumentLinkCollection = textControl.DocumentLinks
Dim target As New DocumentTarget("CustomerDetails")
textControl.DocumentTargets.Add(target)
documentLinkCollection.Add(New DocumentLink("View customer details", target) With { .ID = 100 })Members
Properties
| Property | Description |
|---|---|
| CanAdd | Gets a value indicating whether a new text field can be inserted at the current input position. It is true if a text field can be inserted, otherwise it is false. Text Control cannot insert a text field inside of another text field. (Inherited from TextFieldCollectionBase.) |
| Count | Gets the number of elements contained in the collection. (Inherited from TextFieldCollectionBase.) |
| IsSynchronized | Returns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from TextFieldCollectionBase.) |
| Item | Gets the field with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the DocumentLinkCollection class. |
| SyncRoot | Gets an object that can be used to synchronize access to the collection. (Inherited from TextFieldCollectionBase.) |
Methods
| Method | Description |
|---|---|
| Add | Inserts a new document link at the current input position. |
| Clear | Removes all document links from a Text Control document. |
| CopyTo | Copies the elements of the collection to an array, starting at a particular index. |
| GetEnumerator | Returns an enumerator that can be used to iterate through the collection. (Inherited from TextFieldCollectionBase.) |
| GetItem | Gets a particular document link from the collection. |
| Remove | Removes a document link from a Text Control document. |