Example #1
0
 /// <summary>
 /// Load preference values
 /// </summary>
 protected override void LoadPreferences()
 {
     ignoreUppercase            = SpellingSettings.IgnoreUppercase;
     ignoreWordsWithNumbers     = SpellingSettings.IgnoreWordsWithNumbers;
     realTimeSpellChecking      = SpellingSettings.RealTimeSpellChecking;
     checkSpellingBeforePublish = SpellingSettings.CheckSpellingBeforePublish;
     enableAutoCorrect          = SpellingSettings.EnableAutoCorrect;
     language = SpellingSettings.Language;
 }
Example #2
0
 public static SpellingLanguageEntry GetInstalledLanguage(SpellingCheckerLanguage language)
 {
     foreach (SpellingLanguageEntry entry in GetInstalledLanguages())
     {
         if (entry.Language == language)
         {
             return(entry);
         }
     }
     return(null);
 }
 static SpellingConfigReader()
 {
     // TODO:OLW
     if (languages == null)
     {
         languages = new SpellingLanguageEntry[]
             {
                 CreateNullDictionaryLanguage()
             };
     }
     defaultLanguage = SpellingCheckerLanguage.None;
 }
 static SpellingConfigReader()
 {
     // TODO:OLW
     if (languages == null)
     {
         languages = new SpellingLanguageEntry[]
         {
             CreateNullDictionaryLanguage()
         };
     }
     defaultLanguage = SpellingCheckerLanguage.None;
 }
Example #5
0
        public SpellingPreferencesPanel(SpellingPreferences preferences)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _labelDictionaryLanguage.Text    = Res.Get(StringId.DictionaryLanguageLabel);
            _groupBoxGeneralOptions.Text     = Res.Get(StringId.SpellingPrefOptions);
            _checkBoxRealTimeChecking.Text   = Res.Get(StringId.SpellingPrefReal);
            _checkBoxIgnoreNumbers.Text      = Res.Get(StringId.SpellingPrefNum);
            _checkBoxIgnoreUppercase.Text    = Res.Get(StringId.SpellingPrefUpper);
            _checkBoxCheckBeforePublish.Text = Res.Get(StringId.SpellingPrefPub);
            _checkBoxAutoCorrect.Text        = Res.Get(StringId.SpellingPrefAuto);
            PanelName = Res.Get(StringId.SpellingPrefName);

            // set panel bitmap
            PanelBitmap = _spellingPanelBitmap;

            // initialize preferences
            spellingPreferences = preferences;
            spellingPreferences.PreferencesModified += new EventHandler(spellingPreferences_PreferencesModified);

            // core options
            _checkBoxIgnoreUppercase.Checked    = spellingPreferences.IgnoreUppercase;
            _checkBoxIgnoreNumbers.Checked      = spellingPreferences.IgnoreWordsWithNumbers;
            _checkBoxCheckBeforePublish.Checked = spellingPreferences.CheckSpellingBeforePublish;
            _checkBoxRealTimeChecking.Checked   = spellingPreferences.RealTimeSpellChecking;
            _checkBoxAutoCorrect.Checked        = spellingPreferences.EnableAutoCorrect;

            // initialize language combo
            _comboBoxLanguage.BeginUpdate();
            _comboBoxLanguage.Items.Clear();
            SpellingCheckerLanguage currentLanguage = spellingPreferences.Language;

            SpellingLanguageEntry[] languages = SpellingSettings.GetInstalledLanguages();
            Array.Sort(languages, new SentryLanguageEntryComparer(CultureInfo.CurrentUICulture));

            foreach (SpellingLanguageEntry language in languages)
            {
                int index = _comboBoxLanguage.Items.Add(language);
                if (language.Language == currentLanguage)
                {
                    _comboBoxLanguage.SelectedIndex = index;
                }
            }
            // defend against invalid value
            if (_comboBoxLanguage.SelectedIndex == -1)
            {
                Debug.Fail("Language in registry not supported!");
            }
            _comboBoxLanguage.EndUpdate();

            ManageSpellingOptions();

            // hookup to changed events to update preferences
            _checkBoxIgnoreUppercase.CheckedChanged    += new EventHandler(checkBoxIgnoreUppercase_CheckedChanged);
            _checkBoxIgnoreNumbers.CheckedChanged      += new EventHandler(checkBoxIgnoreNumbers_CheckedChanged);
            _checkBoxCheckBeforePublish.CheckedChanged += new EventHandler(checkBoxCheckBeforePublish_CheckedChanged);
            _checkBoxRealTimeChecking.CheckedChanged   += new EventHandler(checkBoxRealTimeChecking_CheckedChanged);
            _checkBoxAutoCorrect.CheckedChanged        += new EventHandler(checkBoxAutoCorrect_CheckedChanged);

            _comboBoxLanguage.SelectedIndexChanged += new EventHandler(comboBoxLanguage_SelectedIndexChanged);
        }
 /// <summary>
 /// Load preference values
 /// </summary>
 protected override void LoadPreferences()
 {
     ignoreUppercase = SpellingSettings.IgnoreUppercase;
     ignoreWordsWithNumbers = SpellingSettings.IgnoreWordsWithNumbers;
     realTimeSpellChecking = SpellingSettings.RealTimeSpellChecking;
     checkSpellingBeforePublish = SpellingSettings.CheckSpellingBeforePublish;
     enableAutoCorrect = SpellingSettings.EnableAutoCorrect;
     language = SpellingSettings.Language;
 }
 public static SpellingLanguageEntry GetInstalledLanguage(SpellingCheckerLanguage language)
 {
     foreach (SpellingLanguageEntry entry in GetInstalledLanguages())
     {
         if (entry.Language == language)
             return entry;
     }
     return null;
 }