Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Inserts a new document link at the current input position.
Syntax
public bool Add(DocumentLink documentLink);Public Function Add(documentLink As DocumentLink) As BooleanParameters
| Parameter | Description |
|---|---|
| documentLink | Specifies the document link to add. |
Return Value
The return value is true, if the document link could be added. Otherwise it is false.
Examples
The following example works with document links in the current document by using DocumentLinkCollection.Add.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentLinkCollection documentLinkCollection = textControl.DocumentLinks;
if (!documentLinkCollection.Add(new DocumentLink("Quarterly results", new DocumentTarget("CustomerName"))))
{
throw new InvalidOperationException("The item could not be inserted.");
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentLinkCollection As DocumentLinkCollection = textControl.DocumentLinks
If Not documentLinkCollection.Add(New DocumentLink("Quarterly results", New DocumentTarget("CustomerName"))) Then
Throw New InvalidOperationException("The item could not be inserted.")
End If