private void ReloadSchedule() { EnableDisableEditorControls(false); EnableDisableScheduleControls(true); listApps.Items.Clear(); mashSchedule = MashSchedule.FromJson(Settings.Default.Schedule); // Populate the grid if (mashSchedule.Apps != null && mashSchedule.Apps.Count > 0) { foreach (var app in mashSchedule.Apps) { listApps.Items.Add(app); } } }
public static void Go(bool isTestMode = false) { // Test mode? testMode = isTestMode; // Setup a timer to tick every second timer = new DispatcherTimer(); timer.Tick += dispatcherTimer_Tick; timer.Interval = new TimeSpan(0, 0, 1); // Initial delay is five seconds (set to -1 here to indicate initial delay) delayCountdown = -1; // This will execute the schedule from settings schedule = MashSchedule.FromJson(Settings.Default.Schedule); appIndex = 0; logWin = new LogWindow(testMode); logWin.Show(); Log("Schedule starting..."); if (testMode) { Log("=== This is TEST MODE ==="); } if (schedule.Apps.Count < 1) { Log("ERROR: No apps in schedule..."); Finished(); } else { // Start the timer timer.Start(); } }