C# Class AvalonStudio.TextEditor.Document.UndoStack

Inheritance: INotifyPropertyChanged
Show file Open project: VitalElement/AvalonStudio Class Usage Examples

Public Methods

Method Description
ClearAll ( ) : void

Clears both the undo and redo stack.

ClearRedoStack ( ) : void

Call this method, if you want to clear the redo stack

DiscardOriginalFileMarker ( ) : void

Discards the current "original" marker.

EndUndoGroup ( ) : void

Stops grouping changes.

MarkAsOriginalFile ( ) : void

Marks the current state as original. Discards any previous "original" markers.

Push ( IUndoableOperation operation ) : void

Call this method to push an UndoableOperation on the undostack. The redostack will be cleared if you use this method.

PushOptional ( IUndoableOperation operation ) : void

Call this method to push an UndoableOperation on the undostack. However, the operation will be only stored if the undo group contains a non-optional operation. Use this method to store the caret position/selection on the undo stack to prevent having only actions that affect only the caret and not the document.

Redo ( ) : void

Call this method to redo the last undone operation

StartContinuedUndoGroup ( object groupDescriptor = null ) : void

Starts grouping changes, continuing with the previously closed undo group if possible. Maintains a counter so that nested calls are possible. If the call to StartContinuedUndoGroup is a nested call, it behaves exactly as StartUndoGroup(), only top-level calls can continue existing undo groups.

StartUndoGroup ( ) : void

Starts grouping changes. Maintains a counter so that nested calls are possible.

StartUndoGroup ( object groupDescriptor ) : void

Starts grouping changes. Maintains a counter so that nested calls are possible.

Undo ( ) : void

Call this method to undo the last operation on the stack

Private Methods

Method Description
CallEndUpdateOnAffectedDocuments ( ) : void
EnforceSizeLimit ( ) : void
FileModified ( int newElementsOnUndoStack ) : void
NotifyPropertyChanged ( string propertyName ) : void
Push ( IUndoableOperation operation, bool isOptional ) : void
Push ( TextDocument document, DocumentChangeEventArgs e ) : void
RecalcIsOriginalFile ( ) : void
RegisterAffectedDocument ( TextDocument document ) : void
RunRedo ( IUndoableOperation op ) : void
RunUndo ( IUndoableOperation op ) : void
ThrowIfUndoGroupOpen ( ) : void

Throws an InvalidOperationException if an undo group is current open.

Method Details

ClearAll() public method

Clears both the undo and redo stack.
public ClearAll ( ) : void
return void

ClearRedoStack() public method

Call this method, if you want to clear the redo stack
public ClearRedoStack ( ) : void
return void

DiscardOriginalFileMarker() public method

Discards the current "original" marker.
public DiscardOriginalFileMarker ( ) : void
return void

EndUndoGroup() public method

Stops grouping changes.
public EndUndoGroup ( ) : void
return void

MarkAsOriginalFile() public method

Marks the current state as original. Discards any previous "original" markers.
public MarkAsOriginalFile ( ) : void
return void

Push() public method

Call this method to push an UndoableOperation on the undostack. The redostack will be cleared if you use this method.
public Push ( IUndoableOperation operation ) : void
operation IUndoableOperation
return void

PushOptional() public method

Call this method to push an UndoableOperation on the undostack. However, the operation will be only stored if the undo group contains a non-optional operation. Use this method to store the caret position/selection on the undo stack to prevent having only actions that affect only the caret and not the document.
public PushOptional ( IUndoableOperation operation ) : void
operation IUndoableOperation
return void

Redo() public method

Call this method to redo the last undone operation
public Redo ( ) : void
return void

StartContinuedUndoGroup() public method

Starts grouping changes, continuing with the previously closed undo group if possible. Maintains a counter so that nested calls are possible. If the call to StartContinuedUndoGroup is a nested call, it behaves exactly as StartUndoGroup(), only top-level calls can continue existing undo groups.
public StartContinuedUndoGroup ( object groupDescriptor = null ) : void
groupDescriptor object /// An object that is stored with the undo group. /// If this is not a top-level undo group, the parameter is ignored. ///
return void

StartUndoGroup() public method

Starts grouping changes. Maintains a counter so that nested calls are possible.
public StartUndoGroup ( ) : void
return void

StartUndoGroup() public method

Starts grouping changes. Maintains a counter so that nested calls are possible.
public StartUndoGroup ( object groupDescriptor ) : void
groupDescriptor object /// An object that is stored with the undo group. /// If this is not a top-level undo group, the parameter is ignored. ///
return void

Undo() public method

Call this method to undo the last operation on the stack
public Undo ( ) : void
return void