예제 #1
0
 public void Undo()
 {
     if (this.undostack.Count > 0)
     {
         IUndoableOperation undoableOperation = (IUndoableOperation)this.undostack.Pop();
         this.redostack.Push(undoableOperation);
         undoableOperation.Undo();
         this.OnActionUndone();
     }
 }
예제 #2
0
 /// <summary>
 /// Call this method to undo the last operation on the stack
 /// </summary>
 public void Undo()
 {
     if (undostack.Count > 0)
     {
         IUndoableOperation uedit = (IUndoableOperation)undostack.Pop();
         redostack.Push(uedit);
         uedit.Undo();
         OnActionUndone();
     }
 }
예제 #3
0
 public void Undo()
 {
     this.AssertNoUndoGroupOpen();
     if (this.undostack.Count > 0)
     {
         IUndoableOperation undoableOperation = this.undostack.Pop();
         this.redostack.Push(undoableOperation);
         undoableOperation.Undo();
         this.OnActionUndone();
     }
 }
 /// <summary>
 /// Undoes the last operation.
 /// </summary>
 public void Undo()
 {
     AssertNoUndoGroupOpen();
     if (undostack.Count > 0)
     {
         IUndoableOperation uedit = undostack.Pop();
         redostack.Push(uedit);
         uedit.Undo();
         OnActionUndone();
     }
 }
예제 #5
0
파일: UndoStack.cs 프로젝트: rasyidf/Edi
 internal void RunUndo(IUndoableOperation op)
 {
     if (op is IUndoableOperationWithContext opWithCtx)
     {
         opWithCtx.Undo(this);
     }
     else
     {
         op.Undo();
     }
 }
예제 #6
0
파일: UndoStack.cs 프로젝트: Xornent/simula
        internal void RunUndo(IUndoableOperation op)
        {
            IUndoableOperationWithContext opWithCtx = op as IUndoableOperationWithContext;

            if (opWithCtx != null)
            {
                opWithCtx.Undo(this);
            }
            else
            {
                op.Undo();
            }
        }
예제 #7
0
 /// <summary>
 /// Call this method to undo the last operation on the stack
 /// </summary>
 public void Undo()
 {
     if (undoGroupDepth != 0)
     {
         throw new InvalidOperationException("cannot perform Undo/Redo while undo group is open");
     }
     if (undostack.Count > 0)
     {
         IUndoableOperation uedit = (IUndoableOperation)undostack.Pop();
         redostack.Push(uedit);
         uedit.Undo();
         OnActionUndone();
     }
 }
예제 #8
0
 /// <summary>
 /// Call this method to undo the last operation on the stack
 /// </summary>
 public void Undo()
 {
     while (undoGroupDepth != 0) // SSM 24.08.18 - грязный хак в попытке исправления ошибки с Ctrl-Z
     {
         EndUndoGroup();
     }
     if (undoGroupDepth != 0)
     {
         throw new InvalidOperationException("cannot perform Undo/Redo while undo group is open");
     }
     if (undostack.Count > 0)
     {
         IUndoableOperation uedit = (IUndoableOperation)undostack.Pop();
         redostack.Push(uedit);
         uedit.Undo();
         OnActionUndone();
     }
 }
예제 #9
0
 /// <summary>
 /// Call this method to undo the last operation on the stack
 /// </summary>
 public void Undo()
 {
     VerifyNoUndoGroupOpen();
     if (undostack.Count > 0)
     {
         lastGroupDescriptor = null;
         acceptChanges       = false;
         IUndoableOperation uedit = undostack.Pop();
         redostack.Push(uedit);
         uedit.Undo();
         acceptChanges = true;
         if (undostack.Count == 0)
         {
             NotifyPropertyChanged("CanUndo");
         }
         if (redostack.Count == 1)
         {
             NotifyPropertyChanged("CanRedo");
         }
     }
 }
예제 #10
0
        /// <summary>
        /// Undoes the last operation.
        /// </summary>
        public void Undo()
        {
            AssertNoUndoGroupOpen();
            if (InternalUndoStack.Count > 0)
            {
                IUndoableOperation operation = InternalUndoStack.DequeueHead();
                InternalRedoStack.EnqueueHead(operation);
                operation.Undo();
                OnOperationUndone();

                if (InternalUndoStack.Count == 0)
                {
                    OnPropertyChanged(new PropertyChangedEventArgs("CanUndo"));
                }

                if (InternalRedoStack.Count == 1)
                {
                    OnPropertyChanged(new PropertyChangedEventArgs("CanRedo"));
                }

                EnforceSizeLimit();
            }
        }
예제 #11
0
 internal void RunUndo(IUndoableOperation op)
 {
     IUndoableOperationWithContext opWithCtx = op as IUndoableOperationWithContext;
     if (opWithCtx != null)
         opWithCtx.Undo(this);
     else
         op.Undo();
 }