public bool CheckSpelling(string content)
        {
            var spelling = new Spelling();
            spelling.ShowDialog = ShowDialog;

            return spelling.SpellCheck(content);
        }
示例#2
0
        public void SetUp()
        {
            _SpellChecker = new Spelling();
            _SpellChecker.Dictionary.DictionaryFolder = @"..\..\..\..\dic";
            _SpellChecker.Dictionary.Initialize();

            _SpellChecker.ShowDialog = false;
            _SpellChecker.MaxSuggestions = 0;
        }
示例#3
0
		/// <summary>
		///     Default Constructor
		/// </summary>
		public SuggestionForm(Spelling spell)
		{
			this.SpellChecker = spell;
			this.AttachEvents();
			InitializeComponent();
#if BEPOE_EXTENSIONS
			this.Shown += new EventHandler(this.Form_Shown);
#endif
		}
        public NetSpellDictWrapper()
        {
            WordDictionary oDict = new NetSpell.SpellChecker.Dictionary.WordDictionary();

            oDict.DictionaryFile = "en-US.dic";
            //load and initialize the dictionary
            oDict.Initialize();
            Spelling = new Spelling();
            Spelling.Dictionary = oDict;
        }
示例#5
0
		/// <summary>
		///     Default Constructor
		/// </summary>
		public SuggestionForm(Spelling spell)
		{
			this.SpellChecker = spell;
			this.AttachEvents();
			InitializeComponent();			
		}
示例#6
0
        private Spelling NewSpellChecker()
        {
            Spelling _SpellChecker = new Spelling();
            _SpellChecker.Dictionary = _dictionary;

            _SpellChecker.ShowDialog = false;
            return _SpellChecker;
        }
示例#7
0
        private void EditNetSpellLoad(object sender, EventArgs e)
        {
            MistakeFont = new Font(TextBox.Font, FontStyle.Underline);

            components = new Container();
            _spelling =
                new Spelling(components)
                    {
                        ShowDialog = false,
                        IgnoreAllCapsWords = true,
                        IgnoreWordsWithDigits = true
                    };

            //
            // spelling
            //
            _spelling.ReplacedWord += SpellingReplacedWord;
            _spelling.DeletedWord += SpellingDeletedWord;
            _spelling.MisspelledWord += SpellingMisspelledWord;

            //
            // wordDictionary
            //
            LoadDictionary();
        }
示例#8
0
        private Spelling NewSpellChecker()
        {
            Spelling _SpellChecker = new Spelling();
            _SpellChecker.Dictionary = _dictionary;

            _SpellChecker.ShowDialog = false;

            _SpellChecker.DeletedWord += new NetSpell.SpellChecker.Spelling.DeletedWordEventHandler(SpellChecker_DeletedWord);
            _SpellChecker.DoubledWord +=new NetSpell.SpellChecker.Spelling.DoubledWordEventHandler(SpellChecker_DoubledWord);
            _SpellChecker.EndOfText +=new NetSpell.SpellChecker.Spelling.EndOfTextEventHandler(SpellChecker_EndOfText);
            _SpellChecker.IgnoredWord +=new NetSpell.SpellChecker.Spelling.IgnoredWordEventHandler(SpellChecker_IgnoredWord);
            _SpellChecker.MisspelledWord +=new NetSpell.SpellChecker.Spelling.MisspelledWordEventHandler(SpellChecker_MisspelledWord);
            _SpellChecker.ReplacedWord +=new NetSpell.SpellChecker.Spelling.ReplacedWordEventHandler(SpellChecker_ReplacedWord);

            return _SpellChecker;
        }
示例#9
0
		/// <summary>
		///		Default Constructor
		/// </summary>
		public OptionForm(ref Spelling spell)
		{
			this.SpellChecker = spell;
			InitializeComponent();
		}
示例#10
0
文件: ucHTML.cs 项目: infobook/Tools4
        public ucHTML()
        {
            _srcHTMLText = string.Empty;

              InitializeComponent();

              _wb.Navigate("about:blank");

              //pImageCollection = null;

              #region ToolsStrip Image
              _tsbCut.Image = Bitmap.FromHicon(ToolsRes.iiCut.Handle);
              _tsbCopy.Image = Bitmap.FromHicon(ToolsRes.iiCopy.Handle);
              _tsbPaste.Image = Bitmap.FromHicon(ToolsRes.iiPaste.Handle);
              _tsbBold.Image = Bitmap.FromHicon(ToolsRes.iiBold.Handle);
              _tsbItalic.Image = Bitmap.FromHicon(ToolsRes.iiItalic.Handle);
              _tsbUnderline.Image = Bitmap.FromHicon(ToolsRes.iiUnderline.Handle);
              _tsbLeft.Image = Bitmap.FromHicon(ToolsRes.iiJustifyLeft.Handle);
              _tsbCenter.Image = Bitmap.FromHicon(ToolsRes.iiJustifyCenter.Handle);
              _tsbRight.Image = Bitmap.FromHicon(ToolsRes.iiJustifyRight.Handle);
              _tsbUndo.Image = Bitmap.FromHicon(ToolsRes.iiUndo.Handle);
              _tsbRedo.Image = Bitmap.FromHicon(ToolsRes.iiRedo.Handle);
              //_tscFont.Image = Bitmap.FromHicon(ToolsRes.iifo.Handle);
              _tsbPrint.Image = Bitmap.FromHicon(ToolsRes.iiPrint.Handle);
              _tsbPreview.Image = Bitmap.FromHicon(ToolsRes.iiPreview.Handle);
              #endregion

              #region ToolsStrip ToolTipText
              _tsbCut.ToolTipText = ToolsRes.fCut;
              _tsbCopy.ToolTipText = ToolsRes.fCopy;
              _tsbPaste.ToolTipText = ToolsRes.fPaste;
              _tsbBold.ToolTipText = ToolsRes.fBold;
              _tsbItalic.ToolTipText = ToolsRes.fItalic;
              _tsbUnderline.ToolTipText = ToolsRes.fUnderline;
              _tsbLeft.ToolTipText = ToolsRes.fJustifyLeft;
              _tsbCenter.ToolTipText = ToolsRes.fJustifyCenter;
              _tsbRight.ToolTipText = ToolsRes.fJustifyRight;
              _tsbUndo.ToolTipText = ToolsRes.fUndo;
              _tsbRedo.ToolTipText = ToolsRes.fRedo;
              _tscFont.ToolTipText = ToolsRes.fFontChange;
              _tsbPrint.ToolTipText = ToolsRes.fPrintText;
              _tsbPreview.ToolTipText = ToolsRes.fPrintPreviewText;
              _tsbSpellChecker.ToolTipText = ToolsRes.fSpellChecker;
              #endregion

              int ind = 0;
              foreach (FontFamily ff in FontFamily.Families)
              {
            if (ff.IsStyleAvailable(FontStyle.Regular))
              ind = _tscFont.Items.Add(ff.Name);
            }
              _tscFont.ComboBox.DropDownWidth = _tscFont.ComboBox.Width * 2;

            for (ind = 1; ind < 8; ind++)
              _tscSize.Items.Add(ind);

              Controls.Remove(pTS);

              //_wb.
              //_wb.GotFocus += new EventHandler(_wb_GotFocus);

              _tsbSpellChecker.Image =  ToolsRes.Spelling;
              this.components = new System.ComponentModel.Container();
              _spell = new Spelling(this.components);
              _spell.Dictionary = pWordDic;
              //_spell.ReplacedWord += new Spelling.ReplacedWordEventHandler(_spell_ReplacedWord);
              //_spell.DeletedWord += new Spelling.DeletedWordEventHandler(_spell_DeletedWord);
              _spell.EndOfText += new Spelling.EndOfTextEventHandler(_spell_EndOfText);
        }
示例#11
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(StartupForm));
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.trayMenu = new System.Windows.Forms.ContextMenu();
     this.menuSpellCheck = new System.Windows.Forms.MenuItem();
     this.menuItem2 = new System.Windows.Forms.MenuItem();
     this.menuHistory = new System.Windows.Forms.MenuItem();
     this.menuItem3 = new System.Windows.Forms.MenuItem();
     this.menuExit = new System.Windows.Forms.MenuItem();
     this.menuOptions = new System.Windows.Forms.MenuItem();
     this.menuAbout = new System.Windows.Forms.MenuItem();
     this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components);
     this.spelling = new NetSpell.SpellChecker.Spelling(this.components);
     //
     // trayMenu
     //
     this.trayMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                              this.menuSpellCheck,
                                                                              this.menuItem2,
                                                                              this.menuHistory,
                                                                              this.menuItem3,
                                                                              this.menuExit,
                                                                              this.menuOptions,
                                                                              this.menuAbout});
     this.trayMenu.Popup += new System.EventHandler(this.trayMenu_Popup);
     //
     // menuSpellCheck
     //
     this.menuSpellCheck.Index = 0;
     this.menuSpellCheck.Text = "Spell Check Clipboard";
     this.menuSpellCheck.Click += new System.EventHandler(this.menuSpellCheck_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index = 1;
     this.menuItem2.Text = "-";
     //
     // menuHistory
     //
     this.menuHistory.Index = 2;
     this.menuHistory.Text = "Clipboard History";
     //
     // menuItem3
     //
     this.menuItem3.Index = 3;
     this.menuItem3.Text = "-";
     //
     // menuExit
     //
     this.menuExit.Index = 4;
     this.menuExit.Text = "Exit";
     this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
     //
     // menuOptions
     //
     this.menuOptions.Index = 5;
     this.menuOptions.Text = "Options ...";
     this.menuOptions.Click += new System.EventHandler(this.menuOptions_Click);
     //
     // menuAbout
     //
     this.menuAbout.Index = 6;
     this.menuAbout.Text = "About ...";
     this.menuAbout.Click += new System.EventHandler(this.menuAbout_Click);
     //
     // trayIcon
     //
     this.trayIcon.ContextMenu = this.trayMenu;
     this.trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("trayIcon.Icon")));
     this.trayIcon.Text = "Spell Check Clipboard";
     this.trayIcon.Visible = true;
     this.trayIcon.DoubleClick += new System.EventHandler(this.trayIcon_DoubleClick);
     //
     // spelling
     //
     this.spelling.IgnoreAllCapsWords = ((bool)(configurationAppSettings.GetValue("spelling.IgnoreAllCapsWords", typeof(bool))));
     this.spelling.IgnoreWordsWithDigits = ((bool)(configurationAppSettings.GetValue("spelling.IgnoreWordsWithDigits", typeof(bool))));
     this.spelling.MainDictionary = ((string)(configurationAppSettings.GetValue("spelling.MainDictionary", typeof(string))));
     this.spelling.MaxSuggestions = ((int)(configurationAppSettings.GetValue("spelling.MaxSuggestions", typeof(int))));
     this.spelling.UserDictionary = ((string)(configurationAppSettings.GetValue("spelling.UserDictionary", typeof(string))));
     this.spelling.EndOfText += new NetSpell.SpellChecker.Spelling.EndOfTextEventHandler(this.spelling_EndOfText);
     //
     // StartupForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(178, 78);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "StartupForm";
     this.ShowInTaskbar = false;
     this.Text = "Tray Spell";
     this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
     this.Load += new System.EventHandler(this.StartupForm_Load);
 }
示例#12
0
 public void Dispose()
 {
     if (this._spelling != null)
     {
         try
         { this._spelling.Dispose(); }
         catch
         { }
         this._spelling = null;
     }
 }
示例#13
0
 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;
 }
示例#14
0
		public void SetSpellChecker(TextBoxBase extendee, Spelling value)
		{
			_spellChecker = value;
		}
示例#15
-4
        private void EditNetSpellLoad(object sender, EventArgs e)
        {
            MistakeFont = new Font(TextBox.Font, FontStyle.Underline);
            TextBoxFont = TextBox.Font;
            ShowWatermark();

            components = new Container();
            _spelling =
                new Spelling(components)
                    {
                        ShowDialog = false,
                        IgnoreAllCapsWords = true,
                        IgnoreWordsWithDigits = true
                    };

            _autoCompleteListTask.ContinueWith(
                w => _spelling.AddAutoCompleteWords(w.Result.Select(x => x.Word)),
                _autoCompleteCancellationTokenSource.Token,
                TaskContinuationOptions.NotOnCanceled,
                TaskScheduler.FromCurrentSynchronizationContext()
            );
            //
            // spelling
            //
            _spelling.ReplacedWord += SpellingReplacedWord;
            _spelling.DeletedWord += SpellingDeletedWord;
            _spelling.MisspelledWord += SpellingMisspelledWord;

            //
            // wordDictionary
            //
            LoadDictionary();
        }