예제 #1
0
        public override void Persist(ChoConfigSectionObjectMap configSectionObjectMap)
        {
            StringBuilder config    = new StringBuilder();
            Hashtable     keyValues = configSectionObjectMap.ToHashtable();

            foreach (string key in keyValues.Keys)
            {
                if (keyValues[key] != null)
                {
                    config.AppendFormat("<add key=\"{0}\" value=\"{1}\" />{2}", key, keyValues[key].ToString(), Environment.NewLine);
                }
            }

            File.WriteAllText(_configPath, ChoXmlDocument.SetInnerXml(_configPath, ConfigSectionName, config.ToString()));
        }