Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 private void DoCommand(D_Command c)
 {
     UndoRedoC.Do(c);
     UpdateUndoRedoCommands();
 }
Esempio n. 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();
 }