Пример #1
0
        private void LoadDictionaries()
        {
            DictCultureNames = new SortedList<string, string>();
            DirectoryInfo info = new DirectoryInfo(mW.dictDir);
            FileInfo[] dics = info.GetFiles("*.dic");

            diccionarioActivo.Items.Clear();

            foreach (FileInfo fi in dics)
            {
                string nom = Path.GetFileNameWithoutExtension(fi.FullName);
                string nomext = CultureWrapper.GetLanguageName(nom);
                DictCultureNames.Add(nomext, nom); // deberia ser al reves pero weno
                diccionarioActivo.Items.Add(nomext);
            }

            diccionarioActivo.Text = CultureWrapper.GetLanguageName(diccionario);
            string AffFile = Path.Combine(mW.dictDir, DictCultureNames[diccionarioActivo.Text] + ".aff");
            string DicFile = Path.Combine(mW.dictDir, DictCultureNames[diccionarioActivo.Text] + ".dic");

            if (hun != null) hun.Dispose();
            hun = new PerryHunspell(AffFile, DicFile);
            PreviewAssBox.EnableSpellChecking = true;
            PreviewAssBox.DictionaryPath = mW.dictDir;
            PreviewAssBox.Dictionary = DictCultureNames[diccionarioActivo.Text];

            string old = PreviewAssBox.Text; // reset
            PreviewAssBox.Text = "";
            PreviewAssBox.Text = old;
        }
Пример #2
0
 public void LoadDictionary(string AffFile, string DicFile)
 {
     if (!enableSpellChecking) return;
     hun = new PerryHunspell(AffFile, DicFile);
 }