Пример #1
0
        private void CheckSpelling(SpellCheckProperty spellCheckProperty)
        {
            if (spellCheckProperty.HasNextMatch() == true)
            {
                System.Text.RegularExpressions.Match match = spellCheckProperty.GetNextMatch();
                bool correct = this.m_Hunspell.Spell(match.Value);
                if (correct == false)
                {
                    this.m_SuggestedWordList = this.m_Hunspell.Suggest(match.Value);
                    this.NotifyPropertyChanged("SuggestedWordList");

                    this.TextBoxText.Focus();
                    this.TextBoxText.SelectionStart  = match.Index;
                    this.TextBoxText.SelectionLength = match.Length;

                    this.m_CurrentSelectionStart  = match.Index;
                    this.m_CurrentSelectionLength = match.Length;

                    return;
                }
                else
                {
                    this.CheckSpelling(spellCheckProperty);
                }
            }
            else
            {
                //MessageBox.Show("All done.");
            }
        }
Пример #2
0
        private void CheckSpelling(SpellCheckProperty spellCheckProperty)
        {
            if(spellCheckProperty.HasNextMatch() == true)
            {
                System.Text.RegularExpressions.Match match = spellCheckProperty.GetNextMatch();
                bool correct = this.m_Hunspell.Spell(match.Value);
                if (correct == false)
                {
                    this.m_SuggestedWordList = this.m_Hunspell.Suggest(match.Value);
                    this.NotifyPropertyChanged("SuggestedWordList");

                    this.TextBoxText.Focus();
                    this.TextBoxText.SelectionStart = match.Index;
                    this.TextBoxText.SelectionLength = match.Length;

                    this.m_CurrentSelectionStart = match.Index;
                    this.m_CurrentSelectionLength = match.Length;

                    return;
                }
                else
                {
                    this.CheckSpelling(spellCheckProperty);
                }
            }
            else
            {
                //MessageBox.Show("All done.");
            }
        }