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."); } }
private void ButtonSkip_Click(object sender, RoutedEventArgs e) { if (this.m_SpellCheckAccessionOrder.CurrentPropertyListIndex > -1) { this.m_SuggestedWordList = new List <string>(); this.NotifyPropertyChanged("SuggestedWordList"); this.m_SpellCheckAccessionOrder.Skip(); SpellCheckProperty spellCheckProperty = this.m_SpellCheckAccessionOrder.GetCurrentProperty(); if (spellCheckProperty.HasNextMatch() == true) { this.CheckSpelling(spellCheckProperty); } } }
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."); } }