private void EditCriteriaButton(object sender, RoutedEventArgs e) { int id = CriteriasListBox.SelectedIndex; if (id == -1) { editCriteriaWindow = new EditCriteriaWindow(); if (editCriteriaWindow.ShowDialog() == true) { criterias.AddCriteria(editCriteriaWindow.GetCriteriaName()); } for (int i = 0; i < Alternatives.Count; i++) { Alternatives[i].AddParameter(); } } else { editCriteriaWindow = new EditCriteriaWindow(criterias.CriteriasNames[id]); if (editCriteriaWindow.ShowDialog() == true) { criterias.CriteriasNames[id] = editCriteriaWindow.GetCriteriaName(); } } InitializeListBoxes(); InitializeTreeView(); }
private void CreateQuestionsButton(object sender, RoutedEventArgs e) { Criterias tmp = new Criterias(); var idCriteria = CriteriaSwitch.SelectedItems; if (idCriteria.Count < 2) { MessageBox.Show("Wybierz conajmniej dwa kryteria"); } else { for (int i = 0; i < idCriteria.Count; i++) { tmp.AddCriteria(idCriteria[i].ToString()); } CriteriaQuestions = Sort(tmp); var idAlternative = AlternativeSwitch.SelectedItems; if (idAlternative.Count < 2) { MessageBox.Show("Wybierz conajmniej dwie alternatywy"); } else { List <string> list = new List <string>(); for (int i = 0; i < idAlternative.Count; i++) { list.Add(idAlternative[i].ToString()); } AlternativeQuestions = finalAlternatives(list); alternativesSomplete = criteriasComplete = true; combinationsCriteria.SetCouples(CriteriaQuestions.CriteriasNames.Count); combinationAlternatives.SetCouples(AlternativeQuestions.Count); InitializeCriteriaQuestions(); InitializeAlternativeQuestions(); } } }