New to Telerik UI for WinFormsStart a free 30-day trial

Represents the history for a RadDocument.

Definition

Namespace:Telerik.WinForms.Documents.History

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class DocumentHistory

Inheritance: objectDocumentHistory

Constructors

Initializes a new instance of the DocumentHistory class.

C#
public DocumentHistory(RadDocument document)
Parameters:documentRadDocument

The document to track the history for.

Fields

The default maximum number of records in the history stack.

C#
public const int DefaultDepth = 1000

Properties

Gets a value indicating whether redo operation can be exexuted.

C#
public bool CanRedo { get; }
Property Value:

true if this instance can redo; otherwise, false.

Gets a value indicating whether undo operation can be exexuted.

C#
public bool CanUndo { get; }
Property Value:

true if this instance can undo; otherwise, false.

The maximum number of records in the history stack.

C#
public int Depth { get; set; }

Gets or sets a value indicating whether the history for a RadDocument is enabled.

C#
public bool IsEnabled { get; set; }
Property Value:

true if the history is enabled; otherwise, false.

Gets a value indicating whether an undo group has been started.

C#
public bool IsInUndoGroup { get; }
Property Value:

true if this instance is in undo group; otherwise, false.

Methods

Begins a new group of undoable actions.

C#
public void BeginUndoGroup()

Cancels the undo group that has been started using BeginUndoGroup().

C#
public void CancelUndoGroup()

Clears the history.

C#
public void Clear()
Exceptions:

InvalidOperationException

Cannot clear the history while in undo group.

Ends an already opened through BeginUndoGroup() group.

C#
public void EndUndoGroup(string actionDisplayText)
Parameters:actionDisplayTextstring

The text that will be displayed for this undo group.

Gets the last commands in the history.

C#
public List<MultipleUndoPoint> GetLastUndoCommands(int numberOfCommands)
Parameters:numberOfCommandsint

The number of commands.

Returns:

List<MultipleUndoPoint>

A list containing the last commands.

Reverts the document to its state before the last undo operation.

C#
public bool Redo()
Returns:

bool

A value indicating whether the redo operation passed successfully.

Exceptions:

InvalidOperationException

Cannot Redo while in begin undo group.

Reverts the document state before the last modification.

C#
public bool Undo()
Returns:

bool

A boolean value determinig whether the undo operation passed successfuly.

Exceptions:

InvalidOperationException

Cannot Undo while in begin undo group.