Class
DocumentHistory

Represents the history for a RadDocument.

Definition

Namespace:Telerik.WinForms.Documents.History

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

cs-api-definition
public class DocumentHistory

Inheritance: objectDocumentHistory

Constructors

DocumentHistory(RadDocument)

Initializes a new instance of the DocumentHistory class.

Declaration

cs-api-definition
public DocumentHistory(RadDocument document)

Parameters

document

RadDocument

The document to track the history for.

Fields

DefaultDepth

The default maximum number of records in the history stack.

Declaration

cs-api-definition
public const int DefaultDepth = 1000

Field Value

int

Properties

CanRedo

Gets a value indicating whether redo operation can be exexuted.

Declaration

cs-api-definition
public bool CanRedo { get; }

Property Value

bool

true if this instance can redo; otherwise, false.

CanUndo

Gets a value indicating whether undo operation can be exexuted.

Declaration

cs-api-definition
public bool CanUndo { get; }

Property Value

bool

true if this instance can undo; otherwise, false.

Depth

The maximum number of records in the history stack.

Declaration

cs-api-definition
public int Depth { get; set; }

Property Value

int

IsEnabled

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

Declaration

cs-api-definition
public bool IsEnabled { get; set; }

Property Value

bool

true if the history is enabled; otherwise, false.

IsInUndoGroup

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

Declaration

cs-api-definition
public bool IsInUndoGroup { get; }

Property Value

bool

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

Methods

BeginUndoGroup()

Begins a new group of undoable actions.

Declaration

cs-api-definition
public void BeginUndoGroup()

CancelUndoGroup()

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

Declaration

cs-api-definition
public void CancelUndoGroup()

Clear()

Clears the history.

Declaration

cs-api-definition
public void Clear()

Exceptions

InvalidOperationException

Cannot clear the history while in undo group.

EndUndoGroup(string)

Ends an already opened through BeginUndoGroup() group.

Declaration

cs-api-definition
public void EndUndoGroup(string actionDisplayText)

Parameters

actionDisplayText

string

The text that will be displayed for this undo group.

GetLastUndoCommands(int)

Gets the last commands in the history.

Declaration

cs-api-definition
public List<MultipleUndoPoint> GetLastUndoCommands(int numberOfCommands)

Parameters

numberOfCommands

int

The number of commands.

Returns

List<MultipleUndoPoint>

A list containing the last commands.

Redo()

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

Declaration

cs-api-definition
public bool Redo()

Returns

bool

A value indicating whether the redo operation passed successfully.

Exceptions

InvalidOperationException

Cannot Redo while in begin undo group.

Undo()

Reverts the document state before the last modification.

Declaration

cs-api-definition
public bool Undo()

Returns

bool

A boolean value determinig whether the undo operation passed successfuly.

Exceptions

InvalidOperationException

Cannot Undo while in begin undo group.