TX Text Control .NET Server

GetItem Method

Method|Introduced in 30.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

Gets a particular item from the collection.

Syntax

GetItem()

Gets the comment at the current text input position. If there is more than one comment at the current text input position the innermost comment is returned.

public CommentedText GetItem();

GetItem(bool)

Gets the next or the previous comment in the textflow. The search begins at the current text input position.

public CommentedText GetItem(bool next);
ParameterDescription
next

If this parameter is true, the next comment in the textflow is returned. If this parameter is false, the previous comment in the textflow is returned. The next or the previous comment is returned independent whether there is a comment at the current text input position.

Return Value

The return value is null, if a comment could not be found. Otherwise, it is an object of the type CommentedText.

Examples

The following example works with comments in the current document by using CommentCollection.get_Item.

CommentCollection commentCollection = textControl.Comments;
textControl.Text = "Payment is due within 30 days.";
textControl.Select(0, textControl.Text.Length);
commentCollection.Add(new CommentedText("Verify the payment term."));

CommentedText result = commentCollection.GetItem();
result?.ScrollTo();