public T Do(IStack <T> cmd, T input) { var output = cmd.Do(input); _undo.Push(cmd); _redo.Clear(); return(output); }
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); }