/// <summary> /// Raises the incorrect word. /// </summary> /// <param name="args">The <see cref="ActiveUp.WebControls.SpellChecking.IncorrectWordEventArgs"/> instance containing the event data.</param> protected void RaiseIncorrectWord(IncorrectWordEventArgs args) { if (this.IncorrectWord != null) { this.IncorrectWord(this, args); } }
/// <summary> /// Checking all words /// </summary> public void CheckAllWords() { this.RaiseStartCheck(EventArgs.Empty); foreach (Word wrd in this.WordsCollection) { //check if this word need to be ignored CheckIfIgnored(wrd.CurrentWord); //if not if (!this.ignoreThisWord && wrd.CurrentWord.Trim().Length != 0) { //check if word length == 1 if (wrd.CurrentWord.Length == 1 || wrd.CurrentWord.Length == 0) { wrd.IsTrue = true; } if (!wrd.IsTrue) { //check if word is correct wrd.IsTrue = WordIsCorrect(wrd.CurrentWord.ToLower()); if (wrd.IsTrue) { this.RaiseCorrectWord(EventArgs.Empty); } //if not else { string work = wrd.CurrentWord.Substring(0, 2); work = work.Substring(0, 1).ToUpper() + work.Substring(1, 1); //create all posible vaiants of beginning to this word CreatePossibleVarriants(work.ToLower()); //check current word wrd.CheckWord(possibleVarriants); this.IncorrectWordValue = wrd.CurrentWord; this.CorrectWords = wrd.TrueWords; IncorrectWordEventArgs args = new IncorrectWordEventArgs(IncorrectWordProblemEnum.WordIsNotInDict); this.RaiseIncorrectWord(args); ++this.badWordsCount; } } } this.ignoreThisWord = false; } this.wordsCount = this.WordsCollection.Count; #if (LOG) if (this.logFileWriter == null) { this.logFileWriter = new StreamWriter(this.LogFileName); } this.logFileWriter.Write("Total words count " + this.wordsCount + "\r\n"); this.logFileWriter.Write("Bad words count " + this.badWordsCount + "\r\n"); this.logFileWriter.WriteLine("-------------------------------------------------"); this.logFileWriter.WriteLine(); this.logFileWriter.WriteLine(); this.logFileWriter.WriteLine(); this.logFileWriter.Close(); this.logFileClosed = true; #endif this.allWords = new Hashtable(); this.badWordsCount = 0; }