IUndoHistory Interface
Provides the base requirements for an object that tracks undo and redo history for a document and allows re-application of those text changes.
public interface IUndoHistory
Properties
CanRedo
Indicates whether at least one redo text change is available to execute.
bool CanRedo { get; }
Property Value
- bool:
trueif there is at least one redo text change is available to execute; otherwise,false.
CanUndo
Indicates whether at least one undo text change is available to execute.
bool CanUndo { get; }
Property Value
- bool:
trueif there is at least one undo text change is available to execute; otherwise,false.
RedoStack
The IUndoableTextChangeStack containing the redo stack.
UndoStack
The IUndoableTextChangeStack containing the undo stack.
Methods
Clear()
Clears the undo and redo stacks, without resetting change tracking.
void Clear()
Clear(bool)
Clears the undo and redo stacks.
void Clear(bool resetChangeTracking)
| Parameter | Type | Description |
|---|---|---|
| resetChangeTracking | bool | Whether to also reset all change tracking. |
GetChangeTypeForLineRange(int, int)
Returns the SavePointChangeType for the specified line range.
SavePointChangeType GetChangeTypeForLineRange(int startLineIndex, int endLineIndex)
| Parameter | Type | Description |
|---|---|---|
| startLineIndex | int | The start index of the line range to examine. |
| endLineIndex | int | The end index of the line range to examine. |
Returns
Redo()
Performs the top redo text change.
Redo(int)
Performs the specified number of redo text changes.
int Redo(int count)
| Parameter | Type | Description |
|---|---|---|
| count | int | The number of redo text changes to perform. |
Returns
- int:
The number of redo text changes that were performed.
Undo()
Performs the top undo text change.
Undo(int)
Performs the specified number of undo text changes.
int Undo(int count)
| Parameter | Type | Description |
|---|---|---|
| count | int | The number of undo text changes to perform. |
Returns
- int:
The number of undo text changes that were performed.
Events
Cleared
Occurs when the undo history is programmatically cleared.
event EventHandler Cleared
Event Type
Remarks
This event is raised when the Clear() method is called.
UndoRedoRequested
Occurs when an undo or redo operation is requested.
event EventHandler<UndoRedoRequestEventArgs> UndoRedoRequested
Event Type
Remarks
This event is raised when the Undo() or Redo() method is called.