Пример #1
0
 private void Dispose(bool disposing)
 {
     if (_spellChecker != null)
     {
         Marshal.ReleaseComObject(_spellChecker);
         _spellChecker = null;
     }
 }
Пример #2
0
        /// <summary>
        /// Creates a spell checker that supports the specified language
        /// </summary>
        /// <remarks><see cref="SpellChecker.IsLanguageSupported(System.String)"/> can be called to determine if languageTag is supported</remarks>
        /// <exception cref="System.ArgumentException">languageTag is an empty string, or there is no spell checker available for languageTag</exception>
        /// <param name="languageTag">A BCP47 language tag that identifies the language for the requested spell checker</param>
        public SpellChecker(string languageTag)
        {
            var factory = new MsSpellCheckLib.SpellCheckerFactory();

            try
            {
                _spellChecker = factory.CreateSpellChecker(languageTag);
            }
            finally
            {
                Marshal.ReleaseComObject(factory);
            }
        }
Пример #3
0
        /// <summary>
        /// Creates a spell checker that supports the current UI language
        /// </summary>
        public SpellChecker()
        {
            var factory = new MsSpellCheckLib.SpellCheckerFactory();

            try
            {
                _spellChecker = factory.CreateSpellChecker(CultureInfo.CurrentUICulture.Name);
            }
            finally
            {
                Marshal.ReleaseComObject(factory);
            }
        }
Пример #4
0
        /// <summary>
        /// Creates a spell checker that supports the specified language
        /// </summary>
        /// <remarks><see cref="SpellChecker.IsLanguageSupported(System.String)"/> can be called to determine if languageTag is supported</remarks>
        /// <exception cref="System.ArgumentException">languageTag is an empty string, or there is no spell checker available for languageTag</exception>
        /// <param name="languageTag">A BCP47 language tag that identifies the language for the requested spell checker</param>
        public SpellChecker(string languageTag)
        {
            var factory = new MsSpellCheckLib.SpellCheckerFactory();

            try
            {
                _spellChecker = factory.CreateSpellChecker(languageTag);
            }
            finally
            {
                Marshal.ReleaseComObject(factory);
            }
        }
Пример #5
0
        /// <summary>
        /// Creates a spell checker that supports the current UI language
        /// </summary>
        public SpellChecker()
        {
            var factory = new MsSpellCheckLib.SpellCheckerFactory();

            try
            {
                _spellChecker = factory.CreateSpellChecker(CultureInfo.CurrentUICulture.Name);
            }
            finally
            {
                Marshal.ReleaseComObject(factory);
            }
        }
Пример #6
0
 private void Dispose(bool disposing)
 {
     if (_spellChecker != null)
     {
         Marshal.ReleaseComObject(_spellChecker);
         _spellChecker = null;
     }
 }