Exemplo n.º 1
0
        public void LoadDictionary()
        {
            Log.InfoFormat("LoadDictionary called. Keyboard language setting is '{0}'.", Settings.Default.KeyboardAndDictionaryLanguage);

            try
            {
                managedSuggestions = CreateSuggestions();

                // Create reference to the actual storage of the dictionary entries.
                entries = managedSuggestions.GetEntries();

                //Load the user dictionary
                var userDictionaryPath = GetUserDictionaryPath(Settings.Default.KeyboardAndDictionaryLanguage);

                if (File.Exists(userDictionaryPath))
                {
                    LoadUserDictionaryFromFile(userDictionaryPath);
                }
                else
                {
                    LoadDictionaryFromLanguageFile();
                }
            }
            catch (Exception exception)
            {
                PublishError(this, exception);
            }
        }
Exemplo n.º 2
0
        public void LoadDictionary()
        {
            Log.InfoFormat("LoadDictionary called. Keyboard language setting is '{0}'.", Settings.Default.KeyboardAndDictionaryLanguage);

            try
            {
                managedSuggestions = CreateSuggestions();

                if (suggestionMethod == SuggestionMethods.Presage)
                {
                    // If using external dictionary, such as Presage, don't bother loading/saving user dictionaries.
                    return;
                }

                // Create reference to the actual storage of the dictionary entries.
                entries = managedSuggestions.GetEntries();

                //Load the user dictionary
                var userDictionaryPath = GetUserDictionaryPath(Settings.Default.KeyboardAndDictionaryLanguage);

                if (File.Exists(userDictionaryPath))
                {
                    LoadUserDictionaryFromFile(userDictionaryPath);
                }
                else
                {
                    LoadDictionaryFromLanguageFile();
                }
            }
            catch (Exception exception)
            {
                PublishError(this, exception);
            }
        }