TX Text Control .NET Server

CommentedText Class

Class|Introduced in 30.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Core.dll
Install
dotnet add package TXTextControl.TextControl.Core.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

A CommentedText object represents a commented piece of text. A comment can be inserted with a built-in comment input control which can be opened through the context menu when a piece of text has been selected. Additionally, a comment can be inserted trough the CommentCollection.Add methods. All CommentedText objects are contained in the CommentCollection which can be obtained with the Comments property.

Syntax

public class CommentedText

Examples

The following example attaches a reviewer comment to selected contract text.

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

Members

Constructors

ConstructorDescription
CommentedTextInitializes a new instance of the CommentedText class.

Properties

PropertyDescription
ActiveGets or sets a value specifying whether the comment is currently active or not. An inactive comment is not highlighted and is not retrieved through the CommentCollection.GetItem method. When the state changes from active to inactive or vise versa, a CommentStateChanged event occurs.
CommentGets or sets a string which is the comment.
CreationTimeGets the date and time when the comment has been inserted. The time is a Coordinated Universal Time (UTC).
DefaultHighlightColorGets the default highlight color for the commented text. This color is used when the commentator is unknown. When the commentator is the current user, the highlight color is red.
HighlightColorGets or sets the highlight color for the commented text. If the highlight color is CommentedText.DefaultHighlightColor, the highlight color is set to a color depending on the user name. The current user is the first string set with the TextControl.UserNames property.
HighlightModeGets or sets a value indicating whether the commented text is highlighted.
IDGets or sets a user-defined identifier. It must be a one-based value. A value of zero indicates that the comment has no identifier.
LengthGets the number of commented characters.
NumberGets the comment's number. The first comment in the document has the number 1. The number is defined through the textflow. Commented text with a smaller start position has a smaller comment number.
RepliedCommentGets the comment for which this comment is a reply. When this comment is not a reply, null is returned.
RepliesGets all replies of this comment or null if there are no replies.
StartGets the index (one-based) of the first commented character.
TextGets the commented text.
UserNameGets the name of the user who has commented the document. This parameter can be null or an empty string to indicate, that an unknown user has made the comment.

Methods

MethodDescription
EditCommentOpens a comment input control to edit the comment's text.
ReplyToCommentOpens a comment input control to reply to this comment.
SaveSaves the commented text with the specified format.
ScrollToSets the current input position to the first position of the commented text and scrolls it into the visible part of the document.
SelectSelects the commented part of the document.