Ejemplo n.º 1
0
 public void Undo(Action <HistoryEntry> undo)
 {
     if (StackUndo.Count > 0)
     {
         HistoryEntry last = StackUndo.Pop();
         undo.Invoke(last);
         StackRedo.Push(last);
     }
 }
        public IObservable <HistoryEntry> Undo(Func <HistoryEntry, IObservable <HistoryEntry> > discard)
        {
            if (StackUndo.Count == 0)
            {
                throw new Exception();
            }

            UpdateSubjects(true);
            return(discard(StackUndo.Pop()).Do(entry =>
            {
                StackRedo.Push(entry);
                UpdateSubjects();
            }));
        }
 /// <summary>
 /// Добавить команду в стек команд, которые можно выполнить повторно
 /// </summary>
 public void AddInRedo(CommandUndoRedo command)
 {
     StackRedo.Push(command);
 }