示例#1
0
        /// <summary>
        /// Undoes the last done command
        /// </summary>
        internal void Undo()
        {
            if (DoneCommands.Count == 0)
            {
                return;
            }

            D_Command c = DoneCommands.Pop();

            c.ExecuteReverse();
            UndoneCommands.Push(c);
        }
示例#2
0
        /// <summary>
        /// Redoes the last undone command
        /// </summary>
        internal void Redo()
        {
            if (UndoneCommands.Count == 0)
            {
                return;
            }

            D_Command c = UndoneCommands.Pop();

            c.Execute();
            DoneCommands.Push(c);
        }
 private void DoCommand(D_Command c)
 {
     UndoRedoC.Do(c);
     UpdateUndoRedoCommands();
 }
示例#4
0
 /// <summary>
 /// Execute a command for the first time
 /// </summary>
 /// <param name="c">The new command</param>
 internal void Do(D_Command c)
 {
     c.Execute();
     DoneCommands.Push(c);
     UndoneCommands.Clear();
 }