AvalonStudio.TextEditor.Document.UndoStack.Undo C# (CSharp) Method

Undo() public method

Call this method to undo the last operation on the stack
public Undo ( ) : void
return void
		public void Undo()
		{
			ThrowIfUndoGroupOpen();
			if (undostack.Count > 0)
			{
				// disallow continuing undo groups after undo operation
				LastGroupDescriptor = null;
				allowContinue = false;
				// fetch operation to undo and move it to redo stack
				var uedit = undostack.PopBack();
				redostack.PushBack(uedit);
				state = StatePlayback;
				try
				{
					RunUndo(uedit);
				}
				finally
				{
					state = StateListen;
					FileModified(-1);
					CallEndUpdateOnAffectedDocuments();
				}
				RecalcIsOriginalFile();
				if (undostack.Count == 0)
					NotifyPropertyChanged("CanUndo");
				if (redostack.Count == 1)
					NotifyPropertyChanged("CanRedo");
			}
		}