public override void Redo() { foreach (KeyValuePair <Element, ElementTimeInfo> e in m_changedElements) { // Key is reference to actual element. Value is class with the times before undo. // Swap the element's times with the saved times from before the undo, essentially re-doing the original action. ElementTimeInfo.SwapTimes(e.Key, e.Value); } base.Redo(); }
public override void Undo() { foreach (KeyValuePair <Element, ElementTimeInfo> e in m_changedElements) { // Key is reference to actual element. Value is class with its times before move. // Swap the element's times with the saved times from before the move, so we can restore them later in redo. ElementTimeInfo.SwapTimes(e.Key, e.Value); } base.Undo(); }