private void history_CommandExecuted(object sender, CommandEventArgs e) { UpdateUndoMenuItems(); try { historyTrackBar.ValueChanged -= historyTrackBar_ValueChanged; if (e.Reverted) { ++currHistoryPos; ++historyTrackBar.Value; } else { if (currHistoryPos > 0) --currHistoryPos; if (historyTrackBar.Value > 0) --historyTrackBar.Value; } } finally { historyTrackBar.ValueChanged += historyTrackBar_ValueChanged; } }
private void History_CommandAdded(object sender, CommandEventArgs e) { UpdateUndoRedoButtons(); }
private void history_CommandAdded(object sender, CommandEventArgs e) { UpdateUndoMenuItems(); if (CurrentDisplay != null) { if (project.History.UndoCommandCount + project.History.RedoCommandCount != historyTrackBar.Maximum) historyTrackBar.Maximum = project.History.UndoCommandCount + project.History.RedoCommandCount; currHistoryPos = 0; historyTrackBar.Value = 0; } }