示例#1
0
        private void GoNext()
        {
            Guid waitKey = Guid.Empty;

            if (_spellValues == null || !_spellValues.MoveNext())
            {
                if (!_spellEntities.MoveNext())
                {
                    _entity = null;
                    waitKey = FrmWaitScreen.ShowMessage("No spelling errors found in the selected context.", true);
                    this.Close();
                    return;
                }
                _spellValues = _spellEntities.Current.GetSpellValue().AsEnumerable().GetEnumerator();
                _spellValues.MoveNext();
            }

            _currentSpellIntermediate = new SpellCheckIntermediate(_spellEntities.Current, _spellValues.Current.Value, _spellValues.Current.Key);
            ApplyStoredChanges();
            _entity = _aryaSpellChecker.GetSpellCheckEntity(_currentSpellIntermediate);

            if (!_entity.Correct)
            {
                ShowCurrentItem();   //Show the current item and await user input
            }
            else
            {
                ApplyCurrentChanges();
            }
        }
示例#2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     _aryaSpellChecker.AddToProjectDictinary(labelCurrentWord.Text);
     //_aryaSpellChecker.AddToProjectDictinary(labelCurrentWord.Text.First().ToString().ToUpper() + String.Join("", labelCurrentWord.Text.Skip(1)));
     _entity = _aryaSpellChecker.GetSpellCheckEntity(_currentSpellIntermediate);
     ShowCurrentItem();
 }
示例#3
0
 private void tmrWait_Tick(object sender, EventArgs e)
 {
     tmrWait.Stop();
     if (_entity != null)
     {
         int index = richTextValue.SelectionStart;
         //richTextValue.SelectionStart = index;
         _currentSpellIntermediate.SetValue(richTextValue.Text);
         _entity = _aryaSpellChecker.GetSpellCheckEntity(_currentSpellIntermediate);
         ShowCurrentItem();
         richTextValue.Select(index, 0);
     }
 }
示例#4
0
 private void btnIgnoreAll_Click(object sender, EventArgs e)
 {
     _aryaSpellChecker._ignoreAll.Add(labelCurrentWord.Text);
     _entity = _aryaSpellChecker.GetSpellCheckEntity(_currentSpellIntermediate);
     ShowCurrentItem();
 }
示例#5
0
 private void btnIgnore_Click(object sender, EventArgs e)
 {
     _aryaSpellChecker.AddToIgnore(labelCurrentWord.Text, _currentSpellIntermediate.GetISpell());
     _entity = _aryaSpellChecker.GetSpellCheckEntity(_currentSpellIntermediate);
     ShowCurrentItem();
 }
示例#6
0
 private void ReplaceText(string selectedRecommendedWord)
 {
     _currentSpellIntermediate.SetValue(richTextValue.Text.Replace(labelCurrentWord.Text, selectedRecommendedWord).Trim());
     _entity = _aryaSpellChecker.GetSpellCheckEntity(_currentSpellIntermediate);
     ShowCurrentItem();
 }