// Call this before making any change to track. public static void PrepareForChange() { Dirty = true; undoStack.Push(track.Clone() as Track); redoStack.Clear(); UndoRedoStackUpdated?.Invoke(); }
public static void Redo() { if (redoStack.Empty()) { return; } undoStack.Push(track.Clone() as Track); track = redoStack.Pop(); Dirty = true; DirtynessUpdated?.Invoke(Dirty); UndoneOrRedone?.Invoke(); UndoRedoStackUpdated?.Invoke(); }