Beispiel #1
0
        void updateLanguageComboBox()
        {
            var _path = "";

            if (!String.IsNullOrEmpty(CurrentProjectPath))
            {
                _path = SymbolTablesPdf.languageFileDirectory(CurrentProjectPath);
            }

            if (!String.IsNullOrEmpty(CurrentProjectPath) && System.IO.Directory.Exists(_path))
            {
                foreach (var file in System.IO.Directory.GetFiles(_path, "*.json"))
                {
                    var language = System.IO.Path.GetFileNameWithoutExtension(file);
                    if (!languageComboBox.Items.Contains(language))
                    {
                        languageComboBox.Items.Add(language);
                    }
                }
            }
            else
            {
                foreach (var item in Enum.GetValues(typeof(SymbolTablesPdf.LanguageEnum)))
                {
                    if (!languageComboBox.Items.Contains(item.ToString()))
                    {
                        languageComboBox.Items.Add(item.ToString());
                    }
                }
            }
        }