/// <summary> /// Remove selected link /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRemoveCurrentLink_Click(object sender, System.EventArgs e) { try { AttachScripts(); var iRange = this.HtmlDocument.selection.createRange() as mshtml.IHTMLTxtRange; if (!string.IsNullOrEmpty(iRange.htmlText)) { fMessageBox mb = new fMessageBox(Environment.NewLine + LanguagesHelper.Text("cPlzConfirmRmLnkSel", Lang)); mb.ShowDialog(); if (mb.DialogResult == DialogResult.OK) { HtmlDocument.parentWindow.execScript("eucasesRemoveCurrentLink();"); } } else { MessageBox.Show(LanguagesHelper.Text("cPlsSelLink", Lang)); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Set links to the current page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnProcessText_Click(object sender, System.EventArgs e) { try { AttachScripts(); fMessageBox mb = new fMessageBox(LanguagesHelper.Text("cPlzConfirm", Lang)); mb.ShowDialog(); if (mb.DialogResult == DialogResult.OK) { HtmlDocument.parentWindow.execScript("eucasesSetLinks();"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Remove all links from the page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRemoveAllLinks_Click(object sender, System.EventArgs e) { try { AttachScripts(); if (!(HtmlDocument.body.innerHTML.Contains("class=\"eucases-term\"") || HtmlDocument.body.innerHTML.Contains("class=\"eucases-link\""))) { MessageBox.Show(LanguagesHelper.Text("cMsgNoLinksSetByELCFound", Lang)); } else { fMessageBox mb = new fMessageBox(Environment.NewLine + LanguagesHelper.Text("cPlzConfirmRmLnk", Lang)); mb.ShowDialog(); if (mb.DialogResult == DialogResult.OK) { HtmlDocument.parentWindow.execScript("eucasesRemoveAllLinks();"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void bOK_Click(object sender, EventArgs e) { string lang; RegistryHelper.GetLanguage(out lang); if (string.IsNullOrEmpty(lang)) { lang = "en"; } fMessageBox mb = new fMessageBox(Environment.NewLine + LanguagesHelper.Text("cMsgChgLng", lang)); mb.ShowDialog(); if (mb.DialogResult == DialogResult.OK) { // Set values to the registry string username = "******";//this.tbUsername.Text; string password = "******";//this.tbPassword.Text; lang = this.SelectedLanguageAbbr; RegistryHelper.SetValues(username, password, lang); if (OnLangChanged != null) { OnLangChanged(lang); } this.Close(); } }