<p>
        AppSettings mapped to <appSettings&lg; section in the config file, if we want similar settings but we don't want to put our setting in the appSettings, we can create a new tag in the configuration file,  but we use the same ConfigurationSection  Type to handle that.
        </p>


        <pre data-sub="prettyprint:_">
        <?xml version="1.0" encoding="utf-8" ?>
        <configuration>
        <configSections>
        <section name="Keywords"
        type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </configSections>
        <Keywords>
        <add key="test" value="abc"/>
        </Keywords>
        </configuration>
        </pre>


        Then we write our code the access that seciton. Please note that we are not going to use the ConfigurationSection itself, what we are interested is the property in ConfigurationSetting, which is AppSettingsSection.Settings . Below is the code.

        <pre data-sub="prettyprint:_">
        public class Settings
        {
        private static KeyValueConfigurationCollection keywords;
        private static System.Configuration.Configuration config;
        private static System.Configuration.Configuration Config
        {
        get
        {
        if (config == null)
        {
        config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
        }
        return config;
        }
        }

        public static KeyValueConfigurationCollection Keywords
        {
        get
        {
        if (keywords == null)
        {
        AppSettingsSection section = Config.GetSection("Keywords") as AppSettingsSection;
        keywords = section.Settings;
        }
        return keywords;
        }
        }

        public static void Save()
        {
        Config.Save();
        }
        }

        </pre>


        <p>To use the the settings, we can write the following code.
        </p>



        <pre data-sub="prettyprint:_">
        Console.WriteLine(Settings.Keywords.Count.ToString());
        Settings.Keywords.Add("type", "html");
        Settings.Save();
        </pre>