private void UpdateGUI(List <List <Slot> > result) { _raw = result; _cyclicIndex = new CyclicIndex(); if (result == null || result.Count == 0) { if (_inputSlots.NoSlotIsChosen()) { _outputTimetables.SetState(TimetableList.NoSlotsIsChosen); AutoCloseNotificationBar.Show("No subject selected."); } else { _outputTimetables.SetState(TimetableList.NoPossibleCombination); NotificationBar.Show("No possible timetable found.", "Tell me why", () => { DialogBox.Show("Why no possible combination?", new ClashFinder(_subjectModels, _permutator).Message); }, false); } ToolBoxPanel.Visibility = Visibility.Hidden; _cyclicIndex.Reset(); } else { _outputTimetables.SetState(new TimetableList(result)); ToolBoxPanel.Visibility = Visibility.Visible; _cyclicIndex.MaxValue = result.Count - 1; _cyclicIndex.CurrentValue = 0; AutoCloseNotificationBar.Show(result.Count + " possible timetables found."); } TimetableViewer.Initialize(_cyclicIndex); CyclicIndexView.DataContext = new CyclicIndexVM(_cyclicIndex); }
private void UpdateGUI(List <List <Slot> > result) { _raw = result; _cyclicIndex = new CyclicIndex(); if (result == null || result.Count == 0) { if (_inputSlots.NoSlotIsChosen()) { _outputTimetables.SetState(TimetableList.NoSlotsIsChosen); } else { _outputTimetables.SetState(TimetableList.NoPossibleCombination); AutoClosePopup.Show("No possible timetable found."); } ToolBoxPanel.Visibility = Visibility.Hidden; _cyclicIndex.Reset(); } else { _outputTimetables.SetState(new TimetableList(result)); ToolBoxPanel.Visibility = Visibility.Visible; _cyclicIndex.MaxValue = result.Count - 1; _cyclicIndex.CurrentValue = 0; //AutoClosePopup.Show(result.Count + " possible timetables found."); } TimetableViewer.Initialize(_cyclicIndex); CyclicIndexView.DataContext = new CyclicIndexVM(_cyclicIndex); }