public InterlinearSfmImportWizard() { InitializeComponent(); tabSteps.KeyDown += OnKeyDown; tabSteps.KeyUp += OnKeyUp; LexImportWizard.EnsureWindows1252ConverterExists(); }
private void btnStyles_Click(object sender, System.EventArgs e) { XCore.Mediator med = null; LexImportWizard wiz = LexImportWizard.Wizard(); if (wiz != null) { med = wiz.Mediator; } if (med == null) { // See LT-9100 and LT-9266. Apparently this condition can happen. MessageBox.Show(LexTextControls.ksCannotSoTryAgain, LexTextControls.ksInternalProblem, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } med.SendMessage("FormatStyle", null); // The "styles" dialog can trigger a refresh, which disposes of the mediator on the // main window, creating a new one. See LT-7275. // The accessor gets a new one if the old one has been disposed. if (med.IsDisposed) { med = wiz.Mediator; } // We also need to re-initialize the combobox list, since the set of character // styles may have changed. InitializeStylesComboBox(); }
public bool OnSFMImport(object parameters) { Form formActive = ActiveForm; FwXWindow wndActive = formActive as FwXWindow; var importWizard = new LexImportWizard(); ((IFwExtension)importWizard).Init(Cache, wndActive.Mediator); importWizard.ShowDialog(formActive); return(true); }
public bool OnSFMImport(object parameters) { Form formActive = ActiveForm; FwXWindow wndActive = (FwXWindow)formActive; using (var importWizard = new LexImportWizard()) { ((IFwExtension)importWizard).Init(Cache, wndActive.Mediator, wndActive.PropTable); importWizard.ShowDialog(formActive); } return(true); }
private void btnStyles_Click(object sender, EventArgs e) { XCore.PropertyTable propertyTable = null; LexImportWizard wiz = LexImportWizard.Wizard(); if (wiz != null) { propertyTable = wiz.PropTable; } if (propertyTable == null) { // See LT-9100 and LT-9266. Apparently this condition can happen. MessageBox.Show(LexTextControls.ksCannotSoTryAgain, LexTextControls.ksInternalProblem, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } FwStylesDlg.RunStylesDialogForCombo(cbStyle, InitializeStylesComboBox, "", m_stylesheet as LcmStyleSheet, 0, 0, m_cache, this, propertyTable.GetValue <IApp>("App"), m_helpTopicProvider, null); }
private void btnAdd_Click(object sender, System.EventArgs e) { LexImportWizardLanguage dlg = new LexImportWizardLanguage(m_cache, m_uiLangs); if (dlg.ShowDialog(this) == DialogResult.OK) { string langDesc, ws, ec, icu; // retrieve the new WS information from the dlg dlg.GetCurrentLangInfo(out langDesc, out ws, out ec, out icu); // now put the lang info into the language list view if (LexImportWizard.Wizard().AddLanguage(langDesc, ws, ec, icu)) { // this was added to the list of languages, so add it to the dlg and select it Sfm2Xml.LanguageInfoUI langInfo = new Sfm2Xml.LanguageInfoUI(langDesc, ws, ec, icu); if (cbLangDesc.FindStringExact(langInfo.ToString()) < 0) { cbLangDesc.Items.Add(langInfo); } cbLangDesc.SelectedItem = langInfo; } } }