private void parseFiles() { try { string cmlfolderpath = Properties.Settings.Default.CMLDirectory + "\\" + Defaults.CML.FusionFolderName + "\\" + Defaults.CML.FusionBayesianNetworkFolderName + "\\"; string schemespath = cmlfolderpath + "schemes.set"; string sessionsspath = cmlfolderpath + "sessions.set"; StreamReader reader = File.OpenText(schemespath); string line; while ((line = reader.ReadLine()) != null) { string[] items = line.Split(':'); SchemeAnnotatorPair sap = new SchemeAnnotatorPair { Name = items[0], Annotator = items[1] }; SchemeandAnnotatorBox.Items.Add(sap); } SchemeandAnnotatorBox.SelectAll(); StreamReader reader2 = File.OpenText(sessionsspath); while ((line = reader2.ReadLine()) != null) { DatabaseSession session = ((List <DatabaseSession>)SessionsBox.ItemsSource).Find(a => a.Name == line); SessionsBox.SelectedItems.Add(session); } SessionsBox.ScrollIntoView(SessionsBox.SelectedItem); } catch { } }
private void AddItemButton_Click(object sender, RoutedEventArgs e) { foreach (object scheme in SchemesBox.SelectedItems) { string annotator = DatabaseHandler.Annotators.Find(a => a.FullName == AnnotatorInputBox.SelectedItem.ToString()).Name; SchemeAnnotatorPair stp = new SchemeAnnotatorPair() { Name = scheme.ToString(), Annotator = annotator }; if (fusionstreams.Find(item => item.Name == stp.Name) == null) { fusionstreams.Add(stp); SchemeandAnnotatorBox.Items.Add(stp); SchemeandAnnotatorBox.SelectAll(); } } }