CommentCollection 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
- Implements
- ICollection, IEnumerable
Description
Contains all comments in the main text or another part of a document. All comments are associated with a certain piece of text of the document. The collection consists of CommentedText objects, describing the position and length of the commented text and the comment string itself. A collection object can be obtained with the TextControl.Comments, the HeaderFooter.Comments or the TextFrame.Comments property. The CommentCollection class implements the IEnumerable and the ICollection interfaces.
Syntax
public sealed class CommentCollection : ICollection, IEnumerablePublic NotInheritable Class CommentCollection
Implements ICollection, IEnumerableExamples
The following example works with comments in the current document.
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."));Dim commentCollection As 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."))Members
Properties
| Property | Description |
|---|---|
| Count | Gets the number of elements contained in the collection. |
| IsSynchronized | Returns true if the collection is designed to be thread safe, otherwise, it returns false. |
| Item | Gets the comment with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the CommentCollection class. |
| SyncRoot | Gets an object that can be used to synchronize access to the collection. |
Methods
| Method | Description |
|---|---|
| Add | Adds a new comment to the 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. |
| GetItem | Gets a particular item from the collection. |
| Remove | Removes a CommentedText from the collection. The method removes the saved position values and the comment string. The text, which is commented, is not removed from the document. |
Enumerations
| Enumeration | Description |
|---|---|
| AddResult | Specifies the result when a comment has been added to the document. |