Example #1
0
        public bool Undo()
        {
            if (m_rootb != null && m_dataAccess != null)
            {
                SpellingHelper.SetSpellingStatus(m_word, m_wsText, m_dataAccess.WritingSystemFactory, false);
                m_rootb.PropChanged(m_hvoObj, m_tag, m_wsAlt, 1, 1);
                return(true);
            }

            return(false);
        }
Example #2
0
 /// <summary>
 /// Implemented to reset spell-checking everywhere when the spelling status of a wordform changes.
 /// </summary>
 public void PropChanged(int hvo, int tag, int ivMin, int cvIns, int cvDel)
 {
     if (tag == WfiWordformTags.kflidSpellingStatus)
     {
         RestartSpellChecking();
         // This keeps the spelling dictionary in sync with the WFI.
         // Arguably this should be done in FDO. However the spelling dictionary is used to
         // keep the UI showing squiggles, so it's also arguable that it is a UI function.
         // In any case it's easier to do it in PropChanged (which also fires in Undo/Redo)
         // than in a data-change method which does not.
         var    wf   = m_wordformRepos.GetObject(hvo);
         string text = wf.Form.VernacularDefaultWritingSystem.Text;
         if (!string.IsNullOrEmpty(text))
         {
             SpellingHelper.SetSpellingStatus(text, m_cache.DefaultVernWs,
                                              m_cache.LanguageWritingSystemFactoryAccessor,
                                              wf.SpellingStatus == (int)SpellingStatusStates.correct);
         }
     }
 }
Example #3
0
 public bool Redo()
 {
     SpellingHelper.SetSpellingStatus(m_word, m_wsText, m_rootb.DataAccess.WritingSystemFactory, true);
     m_rootb.PropChanged(m_hvoObj, m_tag, m_wsAlt, 1, 1);
     return(true);
 }