Beispiel #1
0
 public void RunAction(IUserAction action)
 {
     UndoQueue.Add(action);
     action.Apply();
     if (RedoQueue.Count != 0)
     {
         RedoQueue.Clear();
     }
 }
Beispiel #2
0
        public bool Redo()
        {
            if (RedoQueue.Count == 0)
            {
                return(false);
            }

            var action = RedoQueue[RedoQueue.Count - 1];

            RedoQueue.RemoveAt(RedoQueue.Count - 1);

            action.Apply();

            UndoQueue.Add(action);

            return(true);
        }