C# Class AvalonStudio.TextEditor.Document.UndoStack

Inheritance: INotifyPropertyChanged
Afficher le fichier Open project: VitalElement/AvalonStudio Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

Clears both the undo and redo stack.
public ClearAll ( ) : void
Résultat void

ClearRedoStack() public méthode

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

DiscardOriginalFileMarker() public méthode

Discards the current "original" marker.
public DiscardOriginalFileMarker ( ) : void
Résultat void

EndUndoGroup() public méthode

Stops grouping changes.
public EndUndoGroup ( ) : void
Résultat void

MarkAsOriginalFile() public méthode

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

Push() public méthode

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
Résultat void

PushOptional() public méthode

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
Résultat void

Redo() public méthode

Call this method to redo the last undone operation
public Redo ( ) : void
Résultat void

StartContinuedUndoGroup() public méthode

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. ///
Résultat void

StartUndoGroup() public méthode

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

StartUndoGroup() public méthode

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. ///
Résultat void

Undo() public méthode

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