Tracking Document Changes

To see who has been making text changes to a document a TextControl offers the track changes feature. It can be turned on or off with the new TextControl.IsTrackChangesEnabled or WPF.TextControl.IsTrackChangesEnabled properties. When the feature is turned on, a TextControl marks up new text changes made to the document. When it is turned off, marking up new changes are stopped. Any changes that were already tracked remain marked up in the document until they are removed. All tracked changes in a document are available through a TrackedChangeCollection which can be obtained through the new TextControl.TrackedChanges or WPF.TextControl.TrackedChanges properties. Every TrackedChange in the collection has a Start and a Length. The ChangeKind property determines the kind of change, deleted or inserted text. The only way to remove tracked changes in a document is to accept or to reject them with the TrackedChangeCollection.Remove method. Each tracked change has a change time and is related to a user. When a new change is tracked, the current user is associated with the change. The current user is the first in the list of users set with the TextControl.UserNames property. When the list of users is empty, the subtextpart's name is set to an empty string which is interpreted as an unknown user. Events occur, when a tracked change is created (TrackedChangeCreated), deleted (TrackedChangeDeleted) or changed (TrackedChangeChanged). A tracked change is highlighted on the screen with a color depending on the user, the default color for the current user is red. Newly inserted text is highlighted through colored text, deleted text is highlighted through colored and strikethrough text. Some complex text operations, for example deleting a table column cannot be tracked. In these cases a CannotTrackChange event occur and the end-user can decide whether the change is made. Tracked changes are saved and can be reloaded with the TextControl text format (.tx), the Rich Text Format (.rtf) and the Microsoft Word formats (.doc, .docx).

Classes

Class Description
TXTextControl.CannotTrackChangeEventArgs The CannotTrackChangeEventArgs class provides data for the CannotTrackChange event.
TXTextControl.TrackedChange A TrackedChange object represents a change made to the document after anyone has revised the document.
TXTextControl.TrackedChangeCollection Contains all tracked changes in the main text or another part of a document.
TXTextControl.TrackedChangeEventArgs The TrackedChangeEventArgs class provides data for the TrackedChangeChanged, TrackedChangeCreated, TrackedChangeStateChanged and TrackedChangeDeleted events.

Properties

Property Description
TXTextControl.ServerTextControl.TrackedChanges Gets a collection of all changes made in the active part of the document.
TXTextControl.TextControl.IsTrackChangesEnabled Gets or sets a value indicating whether track changes is active or not.
TXTextControl.TextControl.TrackedChanges Gets a collection of all changes made in the active part of the document.
TXTextControl.WPF.TextControl.IsTrackChangesEnabled Gets or sets a value indicating whether track changes is active or not.
TXTextControl.WPF.TextControl.TrackedChanges Gets a collection of all changes made in the active part of the document.

Methods

Method Description
TXTextControl.ServerTextControl.OnTrackedChangeCreated Raises the TrackedChangeCreated event.
TXTextControl.ServerTextControl.OnTrackedChangeDeleted Raises the TrackedChangeDeleted event.
TXTextControl.TextControl.OnCannotTrackChange Raises the CannotTrackChange event.
TXTextControl.TextControl.OnTrackedChangeChanged Raises the TrackedChangeChanged event.
TXTextControl.TextControl.OnTrackedChangeCreated Raises the TrackedChangeCreated event.
TXTextControl.TextControl.OnTrackedChangeDeleted Raises the TrackedChangeDeleted event.
TXTextControl.TextControl.OnTrackedChangeStateChanged Raises the TrackedChangeStateChanged event.
TXTextControl.TextControl.OnTrackedChangeStateChanged Raises the TrackedChangeStateChanged event.
TXTextControl.WPF.TextControl.OnCannotTrackChange Raises the CannotTrackChange event.
TXTextControl.WPF.TextControl.OnTrackedChangeChanged Raises the TrackedChangeChanged event.
TXTextControl.WPF.TextControl.OnTrackedChangeCreated Raises the TrackedChangeCreated event.
TXTextControl.WPF.TextControl.OnTrackedChangeDeleted Raises the TrackedChangeDeleted event.

Events

Event Description
TXTextControl.ServerTextControl.TrackedChangeCreated Occurs when a tracked change has been created.
TXTextControl.ServerTextControl.TrackedChangeDeleted Occurs when a tracked change has been deleted.
TXTextControl.TextControl.CannotTrackChange Determines how to handle a change of the document that cannot be added to the list of tracked changes.
TXTextControl.TextControl.TrackedChangeChanged Occurs when the text of a tracked change has been altered.
TXTextControl.TextControl.TrackedChangeCreated Occurs when a tracked change has been created.
TXTextControl.TextControl.TrackedChangeDeleted Occurs when a tracked change has been deleted.
TXTextControl.TextControl.TrackedChangeStateChanged Occurs when the state of a tracked change alters from active to inactive or vice versa.
TXTextControl.WPF.TextControl.CannotTrackChange Determines how to handle a change of the document that cannot be added to the list of tracked changes.
TXTextControl.WPF.TextControl.TrackedChangeChanged Occurs when the text of a tracked change has been altered.
TXTextControl.WPF.TextControl.TrackedChangeCreated Occurs when a tracked change has been created.
TXTextControl.WPF.TextControl.TrackedChangeDeleted Occurs when a tracked change has been deleted.
TXTextControl.WPF.TextControl.TrackedChangeStateChanged Occurs when the state of a tracked change alters from active to inactive or vice versa.