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
Gets whether at least one redo text change is available to execute.
bool CanRedo { get; }
Property Value
- System.Boolean:
trueif there is at least one redo text change is available to execute; otherwise,false.
CanUndo
Gets whether at least one undo text change is available to execute.
bool CanUndo { get; }
Property Value
- System.Boolean:
trueif there is at least one undo text change is available to execute; otherwise,false.
RedoStack
Gets the IUndoableTextChangeStack containing the redo stack.
IUndoableTextChangeStack RedoStack { get; }
Property Value
- IUndoableTextChangeStack:
The IUndoableTextChangeStack containing the redo stack.
UndoStack
Gets the IUndoableTextChangeStack containing the undo stack.
IUndoableTextChangeStack UndoStack { get; }
Property Value
- IUndoableTextChangeStack:
The IUndoableTextChangeStack containing the undo stack.
Methods
Clear()
Clears the undo and redo stacks, without resetting change tracking.
void Clear()
Clear(Boolean)
Clears the undo and redo stacks.
void Clear(bool resetChangeTracking)
| Parameter | Type | Description |
|---|---|---|
| resetChangeTracking | System.Boolean | Whether to also reset all change tracking. |
GetChangeTypeForLineRange(Int32, Int32)
Gets the SavePointChangeType for the specified line range.
SavePointChangeType GetChangeTypeForLineRange(int startLineIndex, int endLineIndex)
| Parameter | Type | Description |
|---|---|---|
| startLineIndex | System.Int32 | The start index of the line range to examine. |
| endLineIndex | System.Int32 | The end index of the line range to examine. |
Returns
- SavePointChangeType:
The SavePointChangeType for the specified line range.
Redo()
Performs the top redo text change.
bool Redo()
Returns
- System.Boolean:
trueif redo text change occurred successfully; otherwise,false.
Redo(Int32)
Performs the specified number of redo text changes.
int Redo(int count)
| Parameter | Type | Description |
|---|---|---|
| count | System.Int32 | The number of redo text changes to perform. |
Returns
- System.Int32:
The number of redo text changes that were performed.
Undo()
Performs the top undo text change.
bool Undo()
Returns
- System.Boolean:
trueif undo text change occurred successfully; otherwise,false.
Undo(Int32)
Performs the specified number of undo text changes.
int Undo(int count)
| Parameter | Type | Description |
|---|---|---|
| count | System.Int32 | The number of undo text changes to perform. |
Returns
- System.Int32:
The number of undo text changes that were performed.
Events
Cleared
Occurs when the undo history is programmatically cleared.
event EventHandler Cleared
Event Type
- System.EventHandler
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
- System.EventHandler<UndoRedoRequestEventArgs>
Remarks
This event is raised when the Undo() or Redo() method is called.