Exemple #1
0
        void item_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = (MenuItem)sender;

            if (item.Tag == EditingCommands.CorrectSpellingError)
            {
                this.textBox1.Select(start, end - start);
                this.textBox1.SelectedText    = item.Header.ToString();
                this.textBox1.SelectionStart  = start + item.Header.ToString().Length;
                this.textBox1.SelectionLength = 0;
            }
            else if (item.Tag == EditingCommands.IgnoreSpellingError)
            {
                speller.IgnoreWord(curWord);
            }
            else if (item.Tag.ToString() == "AddToDict")
            {
                try
                {
                    speller.AddWord(curWord);
                }
                catch
                {
                    MessageBox.Show("Unable to add to user dictionary.", Gui.strProgName, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }

            speller.SpellCheck();
        }
Exemple #2
0
        void item_Click(object sender, RoutedEventArgs e)
        {
            MenuItem item = (MenuItem)sender;

            if (item.Tag == EditingCommands.CorrectSpellingError)
            {
                this.textBox1.Select(start, end - start);
                this.textBox1.SelectedText    = item.Header.ToString();
                this.textBox1.SelectionStart  = start + item.Header.ToString().Length;
                this.textBox1.SelectionLength = 0;
            }
            else if (item.Tag == EditingCommands.IgnoreSpellingError)
            {
                speller.IgnoreWord(curWord);
            }
            else if (item.Tag.ToString() == "AddToDict")
            {
                speller.AddWord(curWord);
            }

            speller.SpellCheck();
        }