private void SelectMissingSessions() { List <DatabaseSession> sessions = (List <DatabaseSession>)SessionsBox.ItemsSource; if (sessions == null) { return; } SessionsBox.SelectAll(); DatabaseScheme scheme = (DatabaseScheme)SchemesBox.SelectedItem; DatabaseAnnotator annotator = (DatabaseAnnotator)AnnotatorsBox.SelectedItem; foreach (DatabaseRole role in RolesBox.SelectedItems) { List <DatabaseAnnotation> annotations = DatabaseHandler.GetAnnotations(scheme, role, annotator); foreach (DatabaseAnnotation annotation in annotations) { DatabaseSession session = sessions.Find(s => s.Name == annotation.Session); if (session != null) { SessionsBox.SelectedItems.Remove(session); } } } }
private void ApplySessionSet() { if (mode == Mode.COMPLETE) { return; } handleSelectionChanged = false; SessionSet set = (SessionSet)SelectSessionSetComboBox.SelectedItem; if (set != null) { SessionsBox.SelectedItems.Clear(); switch (set.Set) { case SessionSet.Type.ALL: SessionsBox.SelectAll(); break; case SessionSet.Type.MISSING: SelectMissingSessions(); break; case SessionSet.Type.FINISHED: SelectFinishedSessions(); break; case SessionSet.Type.FILE: SelectSessionsFromFile(set); break; } } if (SessionsBox.SelectedItems != null) { SessionsBox.ScrollIntoView(SessionsBox.SelectedItem); } handleSelectionChanged = true; }