public Result[] Analyze(string text, bool stopAtFirst) { this._currentResult = new List <Result>(); this._currentReason = CallReasons.String; this._currentText = text; try { if (!string.IsNullOrEmpty(text)) { this._spelling.AlertComplete = false; this._spelling.ShowDialog = false; this._spelling.Text = this._currentText; for (int wi = 0; wi < this._spelling.WordCount; wi++) { this._spelling.SpellCheck(wi, wi); if (stopAtFirst && (this._currentResult.Count > 0)) { break; } } } return(this._currentResult.ToArray()); } catch { throw; } finally { this._currentReason = CallReasons.None; this._currentText = null; this._currentResult = null; } }
internal Worker(SpellChecker spellChecker, CultureInfo cultureInfo, System.ComponentModel.IContainer container) { this._cultureInfo = cultureInfo; this._currentResult = null; this._currentReason = CallReasons.None; this._currentText = null; this._currentTextBox = null; this._spelling = new Spelling(); if (container == null) { this._spelling.Dictionary = new WordDictionary(); } else { this._spelling.Dictionary = new WordDictionary(container); } this._spelling.Dictionary.DictionaryFolder = spellChecker.DictionaryFolderPath; this._spelling.Dictionary.DictionaryFile = spellChecker.GetDictionaryFileName(this._cultureInfo); this._spelling.Dictionary.EnableUserFile = true; this._spelling.Dictionary.UserFile = spellChecker.GetUserDictionaryFileName(this._cultureInfo); this._spelling.IgnoreAllCapsWords = false; this._spelling.IgnoreHtml = false; this._spelling.IgnoreWordsWithDigits = false; this._spelling.DoubledWord += this._spelling_DoubledWord; this._spelling.MisspelledWord += this._spelling_MisspelledWord; this._spelling.DeletedWord += this._spelling_DeletedWord; this._spelling.ReplacedWord += this._spelling_ReplacedWord; }
public void Analyze(TextBox textBox) { this._currentResult = new List <Result>(); this._currentReason = CallReasons.TextBox; this._currentTextBox = textBox; try { this._spelling.AlertComplete = true; this._spelling.ShowDialog = true; this._spelling.Text = this._currentTextBox.Text; this._spelling.ModalDialog = true; this._spelling.SpellCheck(); } catch { throw; } finally { this._currentReason = CallReasons.None; this._currentResult = null; this._currentTextBox = null; } }
public void Analyze(TextBox textBox) { this._currentResult = new List<Result>(); this._currentReason = CallReasons.TextBox; this._currentTextBox = textBox; try { this._spelling.AlertComplete = true; this._spelling.ShowDialog = true; this._spelling.Text = this._currentTextBox.Text; this._spelling.ModalDialog = true; this._spelling.SpellCheck(); } catch { throw; } finally { this._currentReason = CallReasons.None; this._currentResult = null; this._currentTextBox = null; } }
public Result[] Analyze(string text, bool stopAtFirst) { this._currentResult = new List<Result>(); this._currentReason = CallReasons.String; this._currentText = text; try { if (!string.IsNullOrEmpty(text)) { this._spelling.AlertComplete = false; this._spelling.ShowDialog = false; this._spelling.Text = this._currentText; for (int wi = 0; wi < this._spelling.WordCount; wi++) { this._spelling.SpellCheck(wi, wi); if (stopAtFirst && (this._currentResult.Count > 0)) break; } } return this._currentResult.ToArray(); } catch { throw; } finally { this._currentReason = CallReasons.None; this._currentText = null; this._currentResult = null; } }
internal Worker(SpellChecker spellChecker, CultureInfo cultureInfo, System.ComponentModel.IContainer container) { this._cultureInfo = cultureInfo; this._currentResult = null; this._currentReason = CallReasons.None; this._currentText = null; this._currentTextBox = null; this._spelling = new Spelling(); if (container == null) this._spelling.Dictionary = new WordDictionary(); else this._spelling.Dictionary = new WordDictionary(container); this._spelling.Dictionary.DictionaryFolder = spellChecker.DictionaryFolderPath; this._spelling.Dictionary.DictionaryFile = spellChecker.GetDictionaryFileName(this._cultureInfo); this._spelling.Dictionary.EnableUserFile = true; this._spelling.Dictionary.UserFile = spellChecker.GetUserDictionaryFileName(this._cultureInfo); this._spelling.IgnoreAllCapsWords = false; this._spelling.IgnoreHtml = false; this._spelling.IgnoreWordsWithDigits = false; this._spelling.DoubledWord += this._spelling_DoubledWord; this._spelling.MisspelledWord += this._spelling_MisspelledWord; this._spelling.DeletedWord += this._spelling_DeletedWord; this._spelling.ReplacedWord += this._spelling_ReplacedWord; }