Beispiel #1
0
        public T Do(IStack <T> cmd, T input)
        {
            var output = cmd.Do(input);

            _undo.Push(cmd);
            _redo.Clear();
            return(output);
        }
Beispiel #2
0
 public T Redo(T input)
 {
     if (_redo.Count > 0)
     {
         IStack <T> cmd    = _redo.Pop();
         T          output = cmd.Do(input);
         _undo.Push(cmd);
         return(output);
     }
     return(input);
 }