private void Sequence_Open_Click(object sender, RoutedEventArgs e) { try { if (!System.IO.File.Exists(pathTxt.Text)) { Xceed.Wpf.Toolkit.MessageBox.Show("Please select a valid text file in the prompter text path before attempting to run the experiment. "); } else { if (Microphone1_ComboBox.SelectedIndex == -1 || Microphone2_ComboBox.SelectedIndex == -1) { if (MessageBox.Show("You have not selected a microphone. Continue?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) { //do the NO things } else { //do the YES things _mode = 0; _window = 0; sequence = new SequenceForm(MovementCombo.SelectedValue.ToString(), ReadingCombo.SelectedValue.ToString(), AsyncCombo.SelectedValue.ToString(), SyncCombo.SelectedValue.ToString(), SelfPacedCombo.SelectedValue.ToString()); StartFullRecording(); Sequence_Start.IsEnabled = true; Sequence_next(); //TODO Broken sequence start. Tryes to skip over one phase and ends up with null reference. } } } } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message); } }