/// <summary> /// Redos the last change made and pushes it to the undo stack, /// if possible. /// </summary> public void Redo() { if (CanRedo()) { UndoHistory.Push(new AppPalUndo(Palette, RedoHistory.Peek().Name)); var state = RedoHistory.Pop(); SetPalette(state.Palette, false); } }
/// <summary> /// Redos the last change made and pushes it to the undo stack, /// if possible. /// </summary> public void Redo() { if (CanRedo()) { UndoHistory.Push(new AppState(HsvColor, SchemeType)); AppState s = RedoHistory.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()); } }