private void btnAddEC_Click(object sender, EventArgs e) { try { string prevEC = cbEC.Text; using (AddCnvtrDlg dlg = new AddCnvtrDlg(m_helpTopicProvider, m_app, null, cbEC.Text, null, false)) { dlg.ShowDialog(); // Reload the converter list in the combo to reflect the changes. LoadEncodingConverters(); // Either select the new one or select the old one if (dlg.DialogResult == DialogResult.OK && !String.IsNullOrEmpty(dlg.SelectedConverter)) { cbEC.SelectedItem = dlg.SelectedConverter; } else if (cbEC.Items.Count > 0) { cbEC.SelectedItem = prevEC; // preserve selection if possible } } } catch (Exception ex) { MessageBox.Show(String.Format(LexTextControls.ksErrorAccessingEncodingConverters, ex.Message)); return; } }
static void Main() { using (AddCnvtrDlg dlg = new AddCnvtrDlg(FwApp.App, null)) { dlg.ShowDialog(); } }
private bool ShowModifyEncodingConverter(string originalConverter, out string selectedConverter) { selectedConverter = null; using (var dlg = new AddCnvtrDlg(_helpTopicProvider, _app, null, originalConverter, null, false)) { dlg.ShowDialog(); // Either select the new one or select the old one if (dlg.DialogResult == DialogResult.OK && !string.IsNullOrEmpty(dlg.SelectedConverter)) { selectedConverter = dlg.SelectedConverter; return(true); } } return(false); }