/// <summary> /// Handles the Click event of the OkButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void OkButton_Click(object sender, EventArgs e) { if (_showWarning) { if (TerminologyTermbases.SelectedIndex > 0 || TerminologySearchSettings.SelectedIndex > 0) { var warningForm = new TermbaseWarningForm(); if (warningForm.ShowDialog(this) == DialogResult.Cancel) { TerminologyTermbases.SelectedIndex = 0; TerminologySearchSettings.SelectedIndex = 0; } _showWarning = warningForm.ShowAgain; } } _languageMatches = Helpers.Matches(_projectController.SelectedProjects.ToList(), ActiveTemplate); if (!_languageMatches) { var result = MessageBox.Show(@"Selected template has different language directions, or language pairs, from the selected project. Do you still wish to apply the settings from this template?", @"Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question); DialogResult = result == DialogResult.Yes ? DialogResult.OK : DialogResult.None; } else { DialogResult = DialogResult.OK; } }
/// <summary> /// Handles the Click event of the OkButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void OkButton_Click(object sender, EventArgs e) { if (_showWarning) { if (TerminologyTermbases.SelectedIndex > 0 || TerminologySearchSettings.SelectedIndex > 0) { TermbaseWarningForm warningForm = new TermbaseWarningForm(); if (warningForm.ShowDialog(this) == DialogResult.Cancel) { TerminologyTermbases.SelectedIndex = 0; TerminologySearchSettings.SelectedIndex = 0; } _showWarning = warningForm.ShowAgain; } } }
/// <summary> /// Handles the Click event of the OkButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void OkButton_Click(object sender, EventArgs e) { if (this.showWarning) { if (this.TerminologyTermbases.SelectedIndex > 0 || this.TerminologySearchSettings.SelectedIndex > 0) { TermbaseWarningForm warningForm = new TermbaseWarningForm(); if (warningForm.ShowDialog(this) == DialogResult.Cancel) { this.TerminologyTermbases.SelectedIndex = 0; this.TerminologySearchSettings.SelectedIndex = 0; } this.showWarning = warningForm.ShowAgain; } } }