Click here to Skip to main content
15,886,026 members
Articles / DevOps / Load Testing

NHunspell Component for Visual Studio

Rate me:
Please Sign up or sign in to vote.
4.90/5 (31 votes)
1 Sep 2013CPOL6 min read 113.4K   4.1K   46  
NHunspell component example for WindowsForms
using System;
using System.ComponentModel;
using System.Windows.Forms;
using NHunspellComponent.Spelling.Interfaces;

namespace NHunspellComponent.Spelling
{
   public partial class SpellingOptionsFormBasic : Form, ISpellingOptionsWindow
   {
      public event Options.OptionsChangedHandle OptionsChanged;
      private Options opts;

      public SpellingOptionsFormBasic()
      {
         InitializeComponent();
      }

      public void ShowCurOptionsWindow(Options options)
      {
         chIgnoreWordsWithDigits.Checked = options.IgnoreWordsWithDigits;
         chIgnoreWordsInUppercase.Checked = options.IgnoreWordsInUppercase;
         chUseAutoCorrection.Checked = options.UseAutoCorrection;
         ShowDialog();
      }

      private void chIgnoreWordsWithDigits_CheckedChanged(object sender, EventArgs e)
      {
         opts.IgnoreWordsWithDigits = chIgnoreWordsWithDigits.Checked;
      }

      private void chIgnoreWordsInUppercase_CheckedChanged(object sender, EventArgs e)
      {
         opts.IgnoreWordsInUppercase = chIgnoreWordsInUppercase.Checked;
      }

      private void chUseAutoCorrection_CheckedChanged(object sender, EventArgs e)
      {
         opts.UseAutoCorrection = chUseAutoCorrection.Checked;
      }

      private void bSave_Click(object sender, EventArgs e)
      {
         if (OptionsChanged != null)
         {
            OptionsChanged(opts);
         }
         Hide();
      }
   }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Ukraine Ukraine
"a man can do no more than he can" (proverb)
Don't you think there are a lot of things you couldn't do couple of years before but now you can? Things didn't change, but the only thing that changed is belief in yourself.

Comments and Discussions