ClassDocumentHistory
Represents the history for a RadDocument.
Definition
Namespace:Telerik.WinForms.Documents.History
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class DocumentHistory
Inheritance: objectDocumentHistory
Constructors
DocumentHistory(RadDocument)
Initializes a new instance of the DocumentHistory class.
Declaration
public DocumentHistory(RadDocument document)
Parameters
document
The document to track the history for.
Fields
DefaultDepth
The default maximum number of records in the history stack.
Properties
CanRedo
Gets a value indicating whether redo operation can be exexuted.
Declaration
public bool CanRedo { get; }
Property Value
true if this instance can redo; otherwise, false.
CanUndo
Gets a value indicating whether undo operation can be exexuted.
Declaration
public bool CanUndo { get; }
Property Value
true if this instance can undo; otherwise, false.
Depth
The maximum number of records in the history stack.
IsEnabled
Gets or sets a value indicating whether the history for a RadDocument is enabled.
Declaration
public bool IsEnabled { get; set; }
Property Value
true if the history is enabled; otherwise, false.
IsInUndoGroup
Gets a value indicating whether an undo group has been started.
Declaration
public bool IsInUndoGroup { get; }
Property Value
true if this instance is in undo group; otherwise, false.
Methods
BeginUndoGroup()
Begins a new group of undoable actions.
Declaration
public void BeginUndoGroup()
CancelUndoGroup()
Cancels the undo group that has been started using BeginUndoGroup().
Declaration
public void CancelUndoGroup()
Clear()
Clears the history.
Declaration
public void Clear()
Exceptions
Cannot clear the history while in undo group.
EndUndoGroup(string)
Ends an already opened through BeginUndoGroup() group.
Declaration
public void EndUndoGroup(string actionDisplayText)
Parameters
actionDisplayText
The text that will be displayed for this undo group.
GetLastUndoCommands(int)
Gets the last commands in the history.
Declaration
public List<MultipleUndoPoint> GetLastUndoCommands(int numberOfCommands)
Parameters
numberOfCommands
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
public bool Redo()
Returns
A value indicating whether the redo operation passed successfully.
Exceptions
Cannot Redo while in begin undo group.
Undo()
Reverts the document state before the last modification.
Declaration
public bool Undo()
Returns
A boolean value determinig whether the undo operation passed successfuly.
Exceptions
Cannot Undo while in begin undo group.