Exemple #1
0
 private void ProjectManager_ProjectChanged(object sender, EventArgs e)
 {
     UndoHistory.Clear();
     RedoHistory.Clear();
     HistoryLimitExceeded = false;
     CurrentChangeID      = 0;
 }
 public void ClearHistory()
 {
     UndoHistory.Clear();
     RedoHistory.Clear();
     HistoryLimitExceeded = false;
     ProjectIsModified    = false;
     CurrentChangeID      = 0;
 }
Exemple #3
0
 public override void DiscardChanges()
 {
     _directImage.Render();
     UndoHistory.Clear();
     RedoHistory.Clear();
     NotifyOfPropertyChange(() => CanUndo);
     NotifyOfPropertyChange(() => CanRedo);
 }
Exemple #4
0
        private void AddAction(ChangeAction action)
        {
            RedoHistory.Clear();
            UndoHistory.Add(action);
            action.ChangeID = ++CurrentChangeID;

            if (UndoHistory.Count > MaxHistory)
            {
                HistoryLimitExceeded = true;
                UndoHistory.RemoveAt(0);
            }

            UndoHistoryChanged?.Invoke(this, EventArgs.Empty);
        }
Exemple #5
0
    public override void SaveChanges()
    {
        try
        {
            _directImage.SaveImage();

            UndoHistory.Clear();
            RedoHistory.Clear();
            NotifyOfPropertyChange(() => CanUndo);
            NotifyOfPropertyChange(() => CanRedo);

            IsModified = false;
            var changeEvent = new ArrangerChangedEvent(_projectArranger, ArrangerChange.Pixels);
            _events.PublishOnUIThread(changeEvent);
        }
        catch (Exception ex)
        {
            _windowManager.ShowMessageBox($"Could not save the pixel arranger contents\n{ex.Message}\n{ex.StackTrace}", "Save Error");
        }
    }
 /// <summary>
 /// Pushes the current state of the application to the undo stack, and purges the redo stack.
 /// </summary>
 private void PushUndo()
 {
     UndoHistory.Push(new AppState(HsvColor, SchemeType));
     RedoHistory.Clear();
 }
Exemple #7
0
 /// <summary>
 /// Pushes the current state of the application to the undo stack, and purges the redo stack.
 /// </summary>
 private void PushUndo(string action)
 {
     UndoHistory.Push(new AppPalUndo(Palette, action));
     RedoHistory.Clear();
 }