Beispiel #1
0
        /// <summary>
        /// Juggles stacks to "Redo the latest recorded undone action"
        /// </summary>
        public void Redo()
        {
            var redoAct = RedoStack.Pop();

            redoAct();
            DoStack.Push(redoAct);
            UndoStack.Push(BackupStack.Pop());
        }
Beispiel #2
0
        /// <summary>
        /// 작업을 추가합니다.
        /// </summary>
        /// <param name="task"></param>
        public virtual void Push(TaskData task)
        {
            ClearUndoStack();

            DoStack.Push(task);
            task.Do();

            Update();
        }
Beispiel #3
0
 /// <summary>
 /// Juggles stacks to "Do" something
 /// </summary>
 /// <param name="DoAct">Do Action</param>
 /// <param name="UndoAct">Undo Action</param>
 /// <param name="Entry">Weather there should be a new entry for this action in the stacks</param>
 public void Do(Action DoAct, Action UndoAct, bool Entry)
 {
     if (Entry)
     {
         DoStack.Push(DoAct);
         UndoStack.Push(UndoAct);
         RedoStack.Clear();
         BackupStack.Clear();
     }
     DoAct();
 }
Beispiel #4
0
        /// <summary>
        /// 이전 상태로 되돌린 작업을 취소합니다.
        /// </summary>
        /// <returns></returns>
        public bool Redo()
        {
            if (CanRedo)
            {
                TaskData task = UndoStack.Pop();

                DoStack.Push(task);
                task.Do();

                Update();

                return(true);
            }

            return(false);
        }