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