コード例 #1
0
        private void GetProvidersAndLanguages()
        {
            Enchant enchant = new Enchant();

            enchant.Open();
            Logger.Info("[Spellcheck] Found Enchant version: {0}", enchant.Version);

            providers = enchant.GetProviders();
            Logger.Info("[Spellcheck] Found {0} providers: {1}", providers.Length, string.Join(",", providers));

            string[]  langTags = enchant.GetLanguages();
            ArrayList langs    = new ArrayList();

            foreach (string langTag in langTags)
            {
                SpellLanguage language = new SpellLanguage(langTag);
                if (!langs.Contains(language))
                {
                    langs.Add(language);
                }
            }
            langs.Sort();
            languages = (SpellLanguage[])langs.ToArray(typeof(SpellLanguage));
            Logger.Info("[Spellcheck] Found {0} languages: {1}", languages.Length, GetLanguageIDsAsString(languages));

            enchant.Close();
        }