private void AddItemButton_Click(object sender, RoutedEventArgs e) { foreach (var scheme in SchemesBox.SelectedItems) { foreach (var role in RolesBox.SelectedItems) { int classes = 3; //Default value.. AnnoScheme annoscheme = DatabaseHandler.GetAnnotationScheme(scheme.ToString()); if (annoscheme.Type == AnnoScheme.TYPE.DISCRETE) { classes = annoscheme.Labels.Count; } SchemeRoleAnnotator stp = new SchemeRoleAnnotator() { Name = scheme.ToString(), Role = role.ToString(), Annotator = AnnotatorsBox.SelectedItem.ToString(), Classes = classes }; if (selectedAnnotations.Find(item => item.Role == stp.Role && item.Name == stp.Name) == null) { selectedAnnotations.Add(stp); AnnotationSelectionBox.Items.Add(stp); AnnotationSelectionBox.SelectAll(); } } } GetSessions(); }
private void parseFiles() { try { string cmlfolderpath = Properties.Settings.Default.CMLDirectory + "\\" + Defaults.CML.FusionFolderName + "\\" + Defaults.CML.FusionBayesianNetworkFolderName + "\\"; string trainingsetpath = cmlfolderpath + "training.set"; StreamReader reader = File.OpenText(trainingsetpath); string line; while ((line = reader.ReadLine()) != null) { string[] items = line.Split(':'); SchemeRoleAnnotator sap = new SchemeRoleAnnotator { Name = items[0], Annotator = items[1], Role = items[2], Classes = Int32.Parse(items[3]) }; AnnotationSelectionBox.Items.Add(sap); } AnnotationSelectionBox.SelectAll(); } catch { } }