private void StartButton_OnClick(object sender, RoutedEventArgs e) { int n; if (int.TryParse(SessionNumber.Text, out n) && Student1ComboBox.SelectedItem != null && Student2ComboBox.SelectedItem != null) { var learner1Info = ((LearnerInfo)Student1ComboBox.SelectedItem); var learner2Info = ((LearnerInfo)Student2ComboBox.SelectedItem); if (learner1Info != null && learner2Info != null) { if (Client != null) { var startInfo = new StartMessageInfo() { Students = new List<LearnerInfo>() {learner1Info, learner2Info}, SessionId = int.Parse(SessionNumber.Text), /// NOT SAFE AT ALL!!! ScenarioXmlName = "", Language = ScenarioLanguages.English, IsEmpathic = (bool) IsEmpathicCheckBox.IsChecked }; Client.LDBPublisher.Start(startInfo.SerializeToJson()); } Started = true; CountDownUserControl.Start(); } else { MessageBox.Show("Select both students", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } } else { MessageBox.Show("Check your input"); } }
private void StartButton_OnClick(object sender, RoutedEventArgs e) { if (Student1ComboBox.SelectedItem != null) { var learner1Info = ((LearnerInfo)Student1ComboBox.SelectedItem); var learner2Info = ((LearnerInfo)Student2ComboBox.SelectedItem); int SessID = Convert.ToInt32(SessionNumberComboBox.SelectedValue); if (learner1Info != null) { if (Client != null) { var startInfo = new StartMessageInfo() { Students = new List<LearnerInfo>() { learner1Info, learner2Info }, SessionId = SessID,//int.Parse(SessionNumberTextBox.Text), /// NOT SAFE AT ALL!!! ScenarioXmlName = (string) ScenarioComboBox.SelectedItem, Language = (ScenarioLanguages)LanguageComboBox.SelectedItem, IsEmpathic = Convert.ToBoolean(IsEmpathicCheckBox.IsChecked), }; Client.LDBPublisher.Start(startInfo.SerializeToJson()); } Started = true; CountDownUserControl.Start(); ButtonStop.IsEnabled = true; ButtonStart.IsEnabled = false; } else { MessageBox.Show("Select the student", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } } else { MessageBox.Show("Check your input"); } }