WorkbookHistory
Manages undo/redo stacks for workbook modifications, tracking command execution and enabling history navigation.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.History
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class WorkbookHistory
Inheritance: objectWorkbookHistory
Events
Raised when all history entries are removed from the undo and redo stacks.
public event EventHandler Cleared
Raised after a history record is committed to the undo stack, providing the recorded action details.
public event EventHandler<WorkbookHistoryRecordExecutedEventArgs> RecordExecuted
Raised before a new history record begins recording, signaling the start of an undo group.
public event EventHandler RecordExecuting
Raised after a redo operation completes, providing the action that was reapplied.
public event EventHandler<WorkbookHistoryEventArgs> RedoExecuted
Raised before a redo operation begins, providing the action about to be reapplied.
public event EventHandler<WorkbookHistoryEventArgs> RedoExecuting
Raised after an undo operation completes, providing the action that was reversed.
public event EventHandler<WorkbookHistoryEventArgs> UndoExecuted
Raised before an undo operation begins, providing the action about to be reversed.
public event EventHandler<WorkbookHistoryEventArgs> UndoExecuting
Fields
The default depth of the workbook history.
public const int DefaultDepth = 2147483647
Methods
Starts batching subsequent commands into a single composite action that will undo/redo together.
public void BeginUndoGroup()
Aborts the current undo group and reverts all commands executed within it.
public void CancelUndoGroup()
Removes all actions from both undo and redo stacks, resetting history to empty.
public void Clear()
Completes the current undo group and commits the batched commands as a single history entry.
public void EndUndoGroup()
Invokes the Cleared event after removing all history entries.
protected virtual void OnCleared()
Invokes the RecordExecuted event after committing a history action.
protected virtual void OnRecordExecuted(WorkbookHistoryAction historyAction, bool isMerged)
The history action.
isMergedboolThis parameter is not used and is reserved for future use.
Invokes the RecordExecuting event when history recording starts.
protected virtual void OnRecordExecuting()
Invokes the RedoExecuted event after completing a redo operation.
protected virtual void OnRedoExecuted(WorkbookHistoryAction historyAction)
The history action.
Invokes the RedoExecuting event before reapplying a history action.
protected virtual void OnRedoExecuting(WorkbookHistoryAction historyAction)
The history action.
Invokes the UndoExecuted event after completing an undo operation.
protected virtual void OnUndoExecuted(WorkbookHistoryAction historyAction)
The history action.
Invokes the UndoExecuting event before reversing a history action.
protected virtual void OnUndoExecuting(WorkbookHistoryAction historyAction)
The history action.
Reapplies the most recently undone action from the redo stack and returns whether the operation succeeded.
public bool Redo()
The value indicating whether the redo was successfully performed.
Properties
Indicates whether the redo stack contains actions available to reapply.
public bool CanRedo { get; }
The value indicating whether redo can be performed.
Indicates whether the undo stack contains actions available to reverse.
public bool CanUndo { get; }
The value indicating whether undo can be performed.
Maximum number of actions retained in the undo stack before oldest entries are discarded.
public int Depth { get; set; }
The depth of the history.
Controls whether commands are recorded in the undo/redo stacks; when disabled, history is cleared and recording stops.
public bool IsEnabled { get; set; }
The value indicating whether history is enabled.
Indicates whether multiple commands are being batched into a single undoable action via BeginUndoGroup/EndUndoGroup.
public bool IsInUndoGroup { get; }
The value indicating whether the history is currently recording an undo group.