// Load the JSON file private void LoadDisplayListFile(string filename) { if (!File.Exists(filename)) { return; } CurrentDisplayList = CurrentDisplayList.Load(filename); LoadDisplayList(CurrentDisplayList); DisplaySelector.ItemsSource = CurrentDisplayList.Displays; SetDisplay(CurrentDisplayList.CurrentDisplay()); }
// When the user clicks start looping it starts looping. private void LoopButton_Click(object sender, RoutedEventArgs e) { if (LoopButton.Content.Equals("Start Looping")) { LoopButton.Content = "Stop Looping"; // First get the current display Display display = CurrentDisplayList.CurrentDisplay(); // Set the view to that display SetDisplay(display); // Start the timer PageTimer = new System.Timers.Timer(display.Timer * 1000); PageTimer.Elapsed += DisplayTimer_Elapsed; PageTimer.Start(); } else { LoopButton.Content = "Start Looping"; PageTimer.Stop(); } }