DXCore Services – UndoStack
September 19th, 2011
The Undo Stack DXCore Service provides access to the Undo Manager and undo/redo stack of the Visual Studio IDE.
Here are the methods of this service:
Name |
Description |
Abort | Aborts the previously open undo context (canceling all edits made since the context was open). You can open an undo context by calling Undo.BeginUpdate(); |
Add(IUndoUnit) | Adds a custom undo unit to the top of the active undo stack. Note: depending on the state of the stack this may be added to the redo stack. (E.g., if the stack is currently undoing.) Note that it is hidden from Intellisense. |
Add(TextDocument, IUndoUnit) | Adds a custom undo unit to the top of the specified text document’s undo stack. Note: depending on the state of the stack this may be added to the redo stack. (E.g., if the stack is currently undoing.) Note that it is hidden from Intellisense. |
BeginUpdate(String) | Marks the start of a sequence of changes that will be treated as a single undo operation (also known as an “undo context”). |
BeginUpdate(String, Boolean) | Marks the start of a sequence of changes that will be treated as a single undo operation (also known as an “undo context”). You can nest multiple paired calls to BeginUpdate and EndUpdate within each other. |
EndUpdate | Marks the end of a sequence of changes that will be treated as a single undo operation. If this is the outermost EndUpdate for a particular sequence of actions, then the previously-open undo context will be closed and the edit actions will be committed. You can nest multiple paired calls to BeginUpdate and EndUpdate within each other. |
GetRedoDescriptions | Returns an array of redo descriptions from the redo stack for the active text document. |
GetRedoDescriptions (TextDocument) | Returns an array of redo descriptions from the redo stack for the given text document. |
GetUndoDescriptions | Returns an array of undo descriptions from the undo stack for the active text document. |
GetUndoDescriptions (TextDocument) | Returns an array of undo descriptions from the undo stack for the given text document. |
InsertMarker(String) | Inserts an empty undo unit (or “undo marker”) onto the undo stack of the specified text document. This is useful for situations in which the undo stack needs to be restored to a specific state. A System.Int32 cookie value is returned, which can be used with RollbackToMarker to restore the undo stack state. |
InsertMarker (TextDocument, String) | Inserts an empty undo unit (or “undo marker”) onto the undo stack of the specified text document. This is useful in situations in which the undo stack needs to be restored to a specific state. A System.Int32 cookie value is returned, which can be used with RollbackToMarker to restore the undo stack state. |
MarkerIsLast (TextDocument, Int32) | Defines if the specified undo marker is the last in the undo stack. |
Redo | Performs a redo operation. |
RedoExecuted | Returns true if a redo operation is executed. |
RedoTo(String) | Executes a redo up to and including the unit with the specified description on the active redo stack. |
RedoTo(TextDocument, String) | Executes a redo up to and including the unit with the specified description on the redo stack of the specified text document. |
RollbackToMarker (Int32) | Returns the state of the undo stack of the active text document to its position before the specified undo marker. |
RollbackToMarker (TextDocument, Int32) | Returns the state of the undo stack of the specified text document to its position before the specified undo marker. |
Undo | Performs an undo operation. |
UndoTo(String) | Executes an undo up to and including the unit with the specified description on the active undo stack. |
UndoTo(String, String) | Executes an undo up to and including the unit with the specified description on the active undo stack of the given text buffer. |
UndoTo(TextDocument, String) | Executes an undo up to and including the unit with the specified description on the undo stack of the specified text document. |
Properties:
Name |
Description |
IsRedoing | Returns true if a redo operation is executing. |
IsUndoing | Returns true if an undo operation is executing. |
IsValidUndoManager | Checks if the undo manager is valid. |
LastRedoDescription | Returns the description of the last unit on the redo stack or an empty string if the redo stack is empty. |
LastUndoDescription | Returns the description of the last unit on the undo stack or an empty string if the undo stack is empty. |