Example #1
0
 /// <summary>
 ///     This is the method that is responsible for notifying
 ///     receivers that the event occurred
 /// </summary>
 protected virtual void OnIgnoredWord(SpellingEventArgs e)
 {
     if (IgnoredWord != null)
     {
         IgnoredWord(this, e);
     }
 }
Example #2
0
 /// <summary>
 ///     This is the method that is responsible for notifying
 ///     receivers that the event occurred
 /// </summary>
 protected virtual void OnMisspelledWord(SpellingEventArgs e)
 {
     if (MisspelledWord != null)
     {
         MisspelledWord(this, e);
     }
 }
Example #3
0
 private void SpellingMisspelledWord(object sender, SpellingEventArgs e)
 {
     _customUnderlines.Lines.Add(new TextPos(e.TextIndex, e.TextIndex + e.Word.Length));
 }
Example #4
0
 /// <summary>
 ///     This is the method that is responsible for notifying
 ///     receivers that the event occurred
 /// </summary>
 protected virtual void OnDoubledWord(SpellingEventArgs e)
 {
     if (DoubledWord != null)
     {
         DoubledWord(this, e);
     }
 }
Example #5
0
 private void SpellChecker_MisspelledWord(object sender, SpellingEventArgs e)
 {
     _lastSpellingEvent = e;
     _lastEvent = EventNames.MisspelledWord;
 }
Example #6
0
        private void SpellingDeletedWord(object sender, SpellingEventArgs e)
        {
            var start = TextBox.SelectionStart;
            var length = TextBox.SelectionLength;

            TextBox.Select(e.TextIndex, e.Word.Length);
            TextBox.SelectedText = "";

            if (start > TextBox.Text.Length)
                start = TextBox.Text.Length;

            if ((start + length) > TextBox.Text.Length)
                length = 0;

            TextBox.Select(start, length);
        }
 protected void SpellChecker_MisspelledWord(object sender, SpellingEventArgs e)
 {
     SaveValues();
     CurrentWord.Text = SpellChecker.CurrentWord;
     SpellChecker.Suggest();
     Suggestions.DataSource = SpellChecker.Suggestions;
     Suggestions.DataBind();
     ReplacementWord.Text = string.Empty;
     SpellMode.Value = "suggest";
     StatusText.Text = string.Format(wordCounterString, SpellChecker.WordIndex + 1, SpellChecker.WordCount);
 }
Example #8
0
 private void ResetEvents()
 {
     // reset event data
     _lastSpellingEvent = null;
     _lastReplaceEvent = null;
     _lastEvent = EventNames.None;
 }
 protected void SpellChecker_DoubledWord(object sender, SpellingEventArgs e)
 {
     SaveValues();
     lblNotInDictionary.Text = GetString("SpellCheck.DoubledWord");
     CurrentWord.Text = SpellChecker.CurrentWord;
     Suggestions.Items.Clear();
     ReplacementWord.Text = string.Empty;
     SpellMode.Value = "suggest";
     StatusText.Text = string.Format(wordCounterString, SpellChecker.WordIndex + 1, SpellChecker.WordCount);
     btnAdd.Enabled = false;
 }
    protected void SpellChecker_MisspelledWord(object sender, SpellingEventArgs e)
    {
        // Ignore macro content
        if (IsInMacro(e.TextIndex))
        {
            SpellChecker.IgnoreWord();
            SpellChecker.SpellCheck();

            return;
        }

        SaveValues();
        CurrentWord.Text = SpellChecker.CurrentWord;
        SpellChecker.Suggest();

        Suggestions.DataSource = SpellChecker.Suggestions;
        Suggestions.DataBind();

        if (Suggestions.Items.Count > 0)
        {
            Suggestions.SelectedIndex = 0;
        }

        ReplacementWord.Text = Suggestions.SelectedValue;
        SpellMode.Value = "suggest";
        StatusText.Text = string.Format(wordCounterString, SpellChecker.WordIndex + 1, SpellChecker.WordCount);
    }
Example #11
0
 private void _spelling_MisspelledWord(object sender, SpellingEventArgs e)
 {
     switch (this._currentReason)
     {
         case CallReasons.String:
             this._currentResult.Add(new Result(BadReason.Mispelled, e, this._currentText));
             break;
     }
 }
Example #12
0
 private void _spelling_DeletedWord(object sender, SpellingEventArgs e)
 {
     switch (this._currentReason)
     {
         case CallReasons.TextBox:
             int start = this._currentTextBox.SelectionStart;
             int length = this._currentTextBox.SelectionLength;
             this._currentTextBox.Select(e.TextIndex, e.Word.Length);
             this._currentTextBox.SelectedText = "";
             if (start > this._currentTextBox.Text.Length)
                 start = this._currentTextBox.Text.Length;
             if ((start + length) > this._currentTextBox.Text.Length)
                 length = 0;
             this._currentTextBox.Select(start, length);
             break;
     }
 }
Example #13
0
 internal Result(BadReason reason, SpellingEventArgs e, string originalText)
 {
     this.Reason = reason;
     this.SelectionStart = null;
     this.SelectionLength = null;
     this.Word = "";
     if ((e != null) && (!string.IsNullOrEmpty(e.Word)) && (e.TextIndex >= 0))
     {
         this.Word = e.Word;
         this.SelectionStart = e.TextIndex;
         this.SelectionLength = e.Word.Length;
     }
 }