TX Text Control .NET for WPF

TrackedChangeCollection Class

Class|Introduced in 26.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Implements
ICollection, IEnumerable

Description

Contains all tracked changes in the main text or another part of a document. It is a collection of objects of the type TrackedChange. A collection object can be obtained with the TextControl.TrackedChanges, the HeaderFooter.TrackedChanges or the TextFrame.TrackedChanges property. The TrackedChangeCollection class implements the IEnumerable and the ICollection interfaces. A TrackedChange object represents a change of the document after someone has reworked the document. After tracking changes has been turned on with the IsTrackChangesEnabled property, a TextControl marks up new changes made to the document.

Syntax

public sealed class TrackedChangeCollection : ICollection, IEnumerable

Examples

The following example works with tracked changes in the current document. The created object is then available to the surrounding document workflow.

TrackedChangeCollection trackedChangeCollection = textControl.TrackedChanges;
Console.WriteLine("Tracked Change Collection is ready for use.");

Members

Properties

PropertyDescription
CountGets the number of elements contained in the collection.
IsSynchronizedReturns true if the collection is designed to be thread safe, otherwise, it returns false.
ItemGets the change with the specified number from the collection. The number must be between 1 and Count. In C# this property is the indexer for the TrackedChangeCollection class.
SyncRootGets an object that can be used to synchronize access to the collection.

Methods

MethodDescription
CopyToCopies the elements of the collection to an array, starting at a particular index.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection.
GetItemGets a particular item from the collection.
RemoveRemoves a tracked change from the collection. Depending on the accept parameter the change is either accepted or rejected. When a change is rejected, inserted text is removed and deleted text is reinserted.