private void OKButton_Click(object sender, EventArgs e) { if (HexFilePathTextBox.Text == "") { MessageBox.Show("Hex file path cannot be left blank.", "Information", MessageBoxButtons.OK); return; } if ((AVCheckBox.Checked) && (System.Text.RegularExpressions.Regex.IsMatch(AVTextBox.Text, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z") == false)) { MessageBox.Show("Invalid value found. Enter hex numbers only.", "Information", MessageBoxButtons.OK); AVTextBox.Focus(); AVTextBox.SelectAll(); return; } if ((BSVCheckBox.Checked) && (System.Text.RegularExpressions.Regex.IsMatch(BLESVTextBox.Text, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z") == false)) { MessageBox.Show("Invalid value found. Enter hex numbers only.", "Information", MessageBoxButtons.OK); BLESVTextBox.Focus(); BLESVTextBox.SelectAll(); return; } if ((PVCheckBox.Checked) && (System.Text.RegularExpressions.Regex.IsMatch(PVTextBox.Text, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z") == false)) { MessageBox.Show("Invalid value found. Enter hex numbers only.", "Information", MessageBoxButtons.OK); PVTextBox.Focus(); PVTextBox.SelectAll(); return; } if ((HWIDCheckBox.Checked) && (System.Text.RegularExpressions.Regex.IsMatch(HWIDTextBox.Text, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z") == false)) { MessageBox.Show("Invalid value found. Enter hex numbers only.", "Information", MessageBoxButtons.OK); HWIDTextBox.Focus(); HWIDTextBox.SelectAll(); return; } if ((BCCheckBox.Checked) && (System.Text.RegularExpressions.Regex.IsMatch(BCTextBox.Text, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z") == false)) { MessageBox.Show("Invalid value found. Enter hex numbers only.", "Information", MessageBoxButtons.OK); BCTextBox.Focus(); BCTextBox.SelectAll(); return; } if ((MACACheckBox.Checked) && (System.Text.RegularExpressions.Regex.IsMatch(MACATtextBox.Text, @"\A\b(0[xX])?[0-9a-fA-F]+\b\Z") == false)) { MessageBox.Show("Invalid value found. Enter hex numbers only.", "Information", MessageBoxButtons.OK); MACATtextBox.Focus(); MACATtextBox.SelectAll(); return; } ProgAll.SelectedHEXFilePath = HexFilePathTextBox.Text; ProgAll.EnableModuleVerification = ModuleFWValidCheckBox.Checked; ProgAll.ApplicationVersionEnable = AVCheckBox.Checked; ProgAll.BLEStackVersionEnable = BSVCheckBox.Checked; ProgAll.ProtocolVersionEnable = PVCheckBox.Checked; ProgAll.BootCauseEnable = BCCheckBox.Checked; ProgAll.MACAddressEnable = MACACheckBox.Checked; ProgAll.HWIDEnable = HWIDCheckBox.Checked; ProgAll.EventType = EventTypeComboBox.Text; ProgAll.ApplicationVersion = AVTextBox.Text; ProgAll.BLEStackVersion = BLESVTextBox.Text; ProgAll.ProtocolVersion = PVTextBox.Text; ProgAll.BootCause = BCTextBox.Text; ProgAll.MACAddress = MACATtextBox.Text; ProgAll.HWIDValue = HWIDTextBox.Text; ProgAll.UARTCaptureDelay = (int)(DelayNumericUpDown.Value); this.DialogResult = DialogResult.OK; this.Close(); }