示例#1
0
        public static void Undo()
        {
            UndoableAction cmd = Instance.removeFromUndo();

            cmd.Undo();
            Instance.addToRedo(cmd);
        }
示例#2
0
        public static void Redo()
        {
            UndoableAction cmd = Instance.removeFromRedo();

            cmd.Execute();
            Instance.addToUndo(cmd);
        }
示例#3
0
 private void addToRedo(UndoableAction c)
 {
     _redoCommands.Push(c);
     if (_redoCommands.Count == 1)
     {
         OnPropertyChanged("CanRedo");
     }
 }
示例#4
0
        private UndoableAction removeFromRedo()
        {
            UndoableAction result = _redoCommands.Pop();

            if (_redoCommands.Count == 0)
            {
                OnPropertyChanged("CanRedo");
            }
            return(result);
        }
示例#5
0
 public static void Execute(UndoableAction cmd)
 {
     cmd.Execute();
     Instance.addToUndo(cmd);
 }