public static bool SettingExists(CustomConfigSections customConfigSection, string settingName)
        {
            var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var settings   = ((AppSettingsSection)configFile.GetSection(customConfigSection.ToString())).Settings;

            return(settings.AllKeys.Any(s => s == settingName));
        }
        public static Dictionary <string, string> GetSectionSettings(CustomConfigSections customConfigSection)
        {
            var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var settings   = ((AppSettingsSection)configFile.GetSection(customConfigSection.ToString())).Settings;

            return(settings.AllKeys.ToDictionary(key => key, key => settings[key].Value));
        }
        public static void RemoveSetting(CustomConfigSections customConfigSection, string settingName)
        {
            var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var settings   = ((AppSettingsSection)configFile.GetSection(customConfigSection.ToString())).Settings;

            settings.Remove(settingName);

            configFile.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection(configFile.AppSettings.SectionInformation.Name);
        }