private void buttonAddSpellFixer_Click(object sender, EventArgs e) { try { SpellFixerByReflection aSF = new SpellFixerByReflection(); aSF.LoginProject(); ((EncConverters)m_aECs).Reinitialize(); FriendlyName = aSF.SpellFixerEncConverterName; m_aEC = m_aECs[FriendlyName]; if (m_aEC != null) { textBoxFileSpec.Text = ConverterIdentifier = m_aEC.ConverterIdentifier; ConversionType = m_aEC.ConversionType; ProcessType = m_aEC.ProcessType; UpdateUI(false); aSF.QueryForSpellingCorrectionIfTableEmpty("incorect"); aSF.EditSpellingFixes(); IsInRepository = true; } } catch (Exception) { // usually just a "no project selected message, so .... ignoring it // MessageBox.Show(ex.Message, EncConverters.cstrCaption); } }
private void resetToolStripMenuItem_Click(object sender, EventArgs e) { m_aSpellFixer = null; UpdateIconText(); }
protected bool TryLoginProject() { try { if (m_aSpellFixer == null) m_aSpellFixer = new SpellFixerByReflection(); m_aSpellFixer.LoginProject(); // to avoid the annoying error from CC about Converting on an empty table... // go ahead and try to convert what's on the clipboard string strBadWord = "incorect"; IDataObject iData = Clipboard.GetDataObject(); if (iData.GetDataPresent(DataFormats.UnicodeText)) strBadWord = (string)iData.GetData(DataFormats.UnicodeText); m_aSpellFixer.QueryForSpellingCorrectionIfTableEmpty(strBadWord); } catch (Exception ex) { MessageBox.Show(ex.Message, cstrCaption); return false; } return true; }