private void AddButton_Click(object sender, EventArgs e) { if (ModulationListBox.SelectedItem == null) { MessageBox.Show("New channel must have a modulation type."); this.DialogResult = DialogResult.None; return; } if (CallsignInput.TextValue == "") { MessageBox.Show("Channel must have a callsign."); this.DialogResult = DialogResult.None; return; } try { ChannelEditing.AddUserChannelAndMergedChannelInLineup( lineup_, CallsignInput.TextValue, (int)ChannelNumberInput.NumberValue, (int)SubChannelInput.NumberValue, (ModulationListBox.SelectedItem as ModulationTypeWrapper).modulation_type, (int)GuideChannelNumberInput.NumberValue, (int)GuideSubchannelInput.NumberValue, ListingComboBox.SelectedItem as Service); } catch (Exception exc) { ExceptionWithKeyValues key_valued_exception = new ExceptionWithKeyValues(exc); key_valued_exception.AddKeyValue("lineup", lineup_); key_valued_exception.AddKeyValue("Callsign", CallsignInput.TextValue); key_valued_exception.AddKeyValue("Subchannel", SubChannelInput.NumberValue); key_valued_exception.AddKeyValue("Modulation", ModulationListBox.SelectedItem); key_valued_exception.AddKeyValue("GuideNumber", GuideChannelNumberInput.NumberValue); key_valued_exception.AddKeyValue("GuideSubChannel", GuideSubchannelInput.NumberValue); key_valued_exception.AddKeyValue("Service", ListingComboBox.SelectedItem); new ErrorReportingForm("Exception occured when attempting to add a channel", key_valued_exception); } this.DialogResult = AddButton.DialogResult; }