예제 #1
0
		private void SpellChecker_MisspelledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs args)
		{
			TraceWriter.TraceVerbose("Misspelled Word:{0}", args.Word);
			
			int selectionStart = base.SelectionStart;
			int selectionLength = base.SelectionLength;

			base.Select(args.TextIndex, args.Word.Length);

			NativeMethods.CHARFORMAT2 cf = new NativeMethods.CHARFORMAT2();
			cf.cbSize = Marshal.SizeOf(cf);
			cf.dwMask = NativeMethods.CFM_UNDERLINETYPE;
			cf.bUnderlineType = (byte)this.MisspelledStyle; 
			cf.bUnderlineType |= (byte)this.MisspelledColor; 
			
			int result = NativeMethods.SendMessage(base.Handle, 
				NativeMethods.EM_SETCHARFORMAT, 
				NativeMethods.SCF_SELECTION | NativeMethods.SCF_WORD, 
				ref cf);

			base.Select(selectionStart, selectionLength);
		}
예제 #2
0
        private void spelling_ReplacedWord(object sender, NetSpell.SpellChecker.ReplaceWordEventArgs e)
        {
            int start = this.TextBox.SelectionStart;
            int length = this.TextBox.SelectionLength;

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

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

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

            this.TextBox.Select(start, length);
        }
예제 #3
0
 void spelling_MisspelledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
 {
     customUnderlines.Lines.Add(new TextPos(e.TextIndex, e.TextIndex + e.Word.Length));
 }
예제 #4
0
		private void SpellChecker_MisspelledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
		{
			this.UpdateDisplay(this.SpellChecker.Text, e.Word, 
				e.WordIndex, e.TextIndex);

			//turn on ignore all option
			this.IgnoreAllButton.Enabled = true;
			this.ReplaceAllButton.Enabled = true;
			
			//generate suggestions
			SpellChecker.Suggest();

			//display suggestions
			this.SuggestionList.Items.AddRange((string[])SpellChecker.Suggestions.ToArray(typeof(string)));
		}
예제 #5
0
		private void SpellChecker_DoubledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
		{
			this.UpdateDisplay(this.SpellChecker.Text, e.Word, 
				e.WordIndex, e.TextIndex);

			//turn off ignore all option on double word
			this.IgnoreAllButton.Enabled = false;
			this.ReplaceAllButton.Enabled = false;
			this.AddButton.Enabled = false;
		}
예제 #6
0
 protected void SpellChecker_DoubledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
 {
     this.SaveValues();
     lblNotInDictionary.Text = GetString("SpellCheck.DoubledWord");
     this.CurrentWord.Text = this.SpellChecker.CurrentWord;
     this.Suggestions.Items.Clear();
     this.ReplacementWord.Text = string.Empty;
     this.SpellMode.Value = "suggest";
     this.StatusText.Text = string.Format(wordCounterString, this.SpellChecker.WordIndex + 1, this.SpellChecker.WordCount);
 }
예제 #7
0
 protected void SpellChecker_MisspelledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
 {
     this.SaveValues();
     this.CurrentWord.Text = this.SpellChecker.CurrentWord;
     this.SpellChecker.Suggest();
     this.Suggestions.DataSource = this.SpellChecker.Suggestions;
     this.Suggestions.DataBind();
     this.ReplacementWord.Text = string.Empty;
     this.SpellMode.Value = "suggest";
     this.StatusText.Text = string.Format(wordCounterString, this.SpellChecker.WordIndex + 1, this.SpellChecker.WordCount);
 }
예제 #8
0
        private void SpellChecker_DeletedWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
        {
            int start = this.Document.SelectionStart;
            int length = this.Document.SelectionLength;

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

            if(start > this.Document.Text.Length)
                start = this.Document.Text.Length;

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

            this.Document.Select(start, length);
        }
예제 #9
0
 private void spellCheck_ReplacedWord(object sender, NetSpell.SpellChecker.ReplaceWordEventArgs e)
 {
     Debug.Assert(wb.Document != null, "wb.Document != null");
     Debug.Assert(wb.Document.Body != null, "wb.Document.Body != null");
     wb.Document.Body.InnerHtml = e.Text;
 }
예제 #10
0
 private void spellCheck_DeletedWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
 {
     var htmlDocument = wb.Document;
     if (htmlDocument != null) if (htmlDocument.Body != null) htmlDocument.Body.InnerHtml = e.Text;
 }
예제 #11
0
        private void spelling_DeletedWord(object sender, NetSpell.SpellChecker.SpellingEventArgs e)
        {
            int start = this.demoRichText.SelectionStart;
            int length = this.demoRichText.SelectionLength;

            this.demoRichText.Select(e.TextIndex, e.Word.Length);
            this.demoRichText.SelectedText = string.Empty;

            if (start > this.demoRichText.Text.Length)
                start = this.demoRichText.Text.Length;

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

            this.demoRichText.Select(start, length);
        }
예제 #12
0
 private void SpellingMisspelledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs args) {
     // Nothing to do
 }