Ejemplo n.º 1
0
        public void Redo()
        {
            if (redoHistory.Count == 0)
            {
                return;
            }

            var action = redoHistory.Peek();

            action.Do();
            redoHistory.Pop();
            undoHistory.Push(action);
            ActionRedone?.Invoke(this, action);
        }
Ejemplo n.º 2
0
        public void Redo()
        {
            if (Pointer >= history.Count - 1)
            {
                throw new InvalidOperationException("Redo stack is empty");
            }

            Pointer++;

            var item = history[Pointer];

            item.Redo();
            item.State = HistoryItemState.Undo;
            ListStore.SetValue(item.Id, 0, item);
            history[Pointer] = item;

            if (Pointer == history.Count - 1)
            {
                PintaCore.Actions.Edit.Redo.Sensitive = false;
            }

            if (Pointer == clean_pointer)
            {
                document.IsDirty = false;
            }
            else if (item.CausesDirty)
            {
                document.IsDirty = true;
            }

            if (history.Count > 1)
            {
                PintaCore.Actions.Edit.Undo.Sensitive = true;
            }

            ActionRedone?.Invoke(this, EventArgs.Empty);
        }
 /// <summary>
 /// </summary>
 protected void OnActionRedone()
 {
     ActionRedone?.Invoke(sender: null, e: null);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// </summary>
 protected void OnActionRedone()
 {
     ActionRedone?.Invoke(null, null);
 }