/// <summary> /// Undoes the last change made and pushes it to the redo stack, /// if possible. /// </summary> public void Undo() { if (CanUndo()) { RedoHistory.Push(new AppPalUndo(Palette, UndoHistory.Peek().Name)); var state = UndoHistory.Pop(); SetPalette(state.Palette, false); } }
/// <summary> /// Undoes the last change made and pushes it to the redo stack, /// if possible. /// </summary> public void Undo() { if (CanUndo()) { RedoHistory.Push(new AppState(HsvColor, SchemeType)); AppState s = UndoHistory.Pop(); SetColor(s.Color, false, false); SetSchemeType(s.SchemeType, false, false); // because we didn't use the setters to fire events // because we'd be wastefully firing two otherwise OnResultChanged(new EventArgs()); } }