Ejemplo n.º 1
0
        private void buttonUknownToNames_Click(object sender, EventArgs e)
        {
            if (listBoxUnknownWords.Items.Count > 0 && listBoxUnknownWords.SelectedItems.Count > 0)
            {
                string text = listBoxUnknownWords.SelectedItems[0].ToString();
                if (text.Contains(':'))
                {
                    if (_ocrFixEngine == null)
                        comboBoxDictionaries_SelectedIndexChanged(null, null);

                    text = text.Substring(text.IndexOf(':') + 1).Trim();
                    using (var form = new AddToNamesList())
                    {
                        form.Initialize(_subtitle, comboBoxDictionaries.Text, text);
                        if (form.ShowDialog(this) == DialogResult.OK)
                        {
                            comboBoxDictionaries_SelectedIndexChanged(null, null);
                            UpdateUnknownWordColoring(form.NewName, StringComparison.Ordinal);
                            ShowStatus(string.Format(Configuration.Settings.Language.Main.NameXAddedToNamesEtcList, form.NewName));
                        }
                        else if (!string.IsNullOrEmpty(form.NewName))
                        {
                            MessageBox.Show(string.Format(Configuration.Settings.Language.Main.NameXNotAddedToNamesEtcList, form.NewName));
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void AddWordToNamesetcListToolStripMenuItemClick(object sender, EventArgs e)
 {
     using (var addToNamesList = new AddToNamesList())
     {
         addToNamesList.Initialize(_subtitle, textBoxListViewText.SelectedText);
         if (addToNamesList.ShowDialog(this) == DialogResult.OK)
             ShowStatus(string.Format(_language.NameXAddedToNamesEtcList, addToNamesList.NewName));
         else if (!string.IsNullOrEmpty(addToNamesList.NewName))
             ShowStatus(string.Format(_language.NameXNotAddedToNamesEtcList, addToNamesList.NewName));
     }
 }