コード例 #1
0
            static SpellCheckerFactory()
            {
                Singleton = new SpellCheckerFactory();

                bool creationResult = false;

                _factoryLock.WithWriteLock(CreateLockFree, true, true, out creationResult);
            }
コード例 #2
0
        internal static RCW.ISpellChecker CreateSpellChecker(string languageTag, bool suppressCOMExceptions = true)
        {
            SpellCheckerFactory singleton = SpellCheckerFactory.Singleton;

            if (singleton == null)
            {
                return(null);
            }
            return(singleton.CreateSpellCheckerPrivate(languageTag, suppressCOMExceptions));
        }
コード例 #3
0
        // Token: 0x0600409B RID: 16539 RVA: 0x0012724A File Offset: 0x0012544A
        internal static void UnregisterUserDictionary(string dictionaryPath, string languageTag, bool suppressCOMExceptions = true)
        {
            SpellCheckerFactory singleton = SpellCheckerFactory.Singleton;

            if (singleton == null)
            {
                return;
            }
            singleton.UnregisterUserDictionaryPrivate(dictionaryPath, languageTag, suppressCOMExceptions);
        }
コード例 #4
0
        // Token: 0x0600408B RID: 16523 RVA: 0x00126EC7 File Offset: 0x001250C7
        internal static List <string> GetSupportedLanguages(bool shouldSuppressCOMExceptions = true)
        {
            SpellCheckerFactory singleton = SpellCheckerFactory.Singleton;

            if (singleton == null)
            {
                return(null);
            }
            return(singleton.GetSupportedLanguagesPrivate(shouldSuppressCOMExceptions));
        }
コード例 #5
0
            public bool CreateSpellCheckerRetryPreamble(out Func <RCW.ISpellChecker> func)
            {
                func = null;
                bool result;

                if (result = SpellCheckerFactory.Reinitalize())
                {
                    func = new Func <RCW.ISpellChecker>(SpellCheckerFactory.SpellCheckerCreationHelper.Helper(this._language).CreateSpellChecker);
                }
                return(result);
            }
コード例 #6
0
        // Token: 0x06004083 RID: 16515 RVA: 0x00126C20 File Offset: 0x00124E20
        public static SpellCheckerFactory Create(bool shouldSuppressCOMExceptions = false)
        {
            SpellCheckerFactory result = null;
            bool flag = false;

            if (SpellCheckerFactory._factoryLock.WithWriteLock <bool, bool, bool>(new Func <bool, bool, bool>(SpellCheckerFactory.CreateLockFree), shouldSuppressCOMExceptions, false, out flag) && flag)
            {
                result = SpellCheckerFactory.Singleton;
            }
            return(result);
        }
コード例 #7
0
                public bool CreateSpellCheckerRetryPreamble(out Func <RCW.ISpellChecker> func)
                {
                    bool success = false;

                    func = null;

                    if (success = SpellCheckerFactory.Reinitalize())
                    {
                        func = SpellCheckerCreationHelper.Helper(_language).CreateSpellChecker;
                    }

                    return(success);
                }
コード例 #8
0
            public static SpellCheckerFactory Create(bool shouldSuppressCOMExceptions = false)
            {
                SpellCheckerFactory result = null;

                bool creationSucceeded = false;

                if (
                    _factoryLock.WithWriteLock(CreateLockFree, shouldSuppressCOMExceptions, false, out creationSucceeded) &&
                    creationSucceeded)
                {
                    result = Singleton;
                }

                return(result);
            }
コード例 #9
0
 // Token: 0x06004099 RID: 16537 RVA: 0x00127178 File Offset: 0x00125378
 private void UnregisterUserDictionaryImplWithRetries(string dictionaryPath, string languageTag, bool suppressCOMExceptions = true)
 {
     if (dictionaryPath == null)
     {
         throw new ArgumentNullException("dictionaryPath");
     }
     if (languageTag == null)
     {
         throw new ArgumentNullException("languageTag");
     }
     RetryHelper.TryCallAction(delegate()
     {
         this.UnregisterUserDictionaryImpl(dictionaryPath, languageTag);
     }, () => SpellCheckerFactory.Reinitalize(), SpellCheckerFactory.SuppressedExceptions[suppressCOMExceptions], 3, false);
 }
コード例 #10
0
 private bool Init(bool shouldSuppressCOMExceptions = true)
 {
     this._speller.Value = SpellCheckerFactory.CreateSpellChecker(this._languageTag, shouldSuppressCOMExceptions);
     return(this._speller.Value != null);
 }
コード例 #11
0
        // Token: 0x0600408D RID: 16525 RVA: 0x00126EF8 File Offset: 0x001250F8
        private bool IsSupportedImplWithRetries(string languageTag, bool suppressCOMExceptions = true)
        {
            bool flag = false;

            return(RetryHelper.TryExecuteFunction <bool>(() => this.IsSupportedImpl(languageTag), out flag, () => SpellCheckerFactory.Reinitalize(), SpellCheckerFactory.SuppressedExceptions[suppressCOMExceptions], 3, false) && flag);
        }
コード例 #12
0
        // Token: 0x06004089 RID: 16521 RVA: 0x00126E40 File Offset: 0x00125040
        private List <string> SupportedLanguagesImplWithRetries(bool shouldSuppressCOMExceptions)
        {
            List <string> result = null;

            if (!RetryHelper.TryExecuteFunction <List <string> >(new Func <List <string> >(this.SupportedLanguagesImpl), out result, () => SpellCheckerFactory.Reinitalize(), SpellCheckerFactory.SuppressedExceptions[shouldSuppressCOMExceptions], 3, false))
            {
                return(null);
            }
            return(result);
        }