Exemple #1
0
        /// <summary>
        /// Applies any Delete modifications
        /// </summary>
        /// <param name="mod">The mod.</param>
        private void Delete(IniDelete mod)
        {
            try
            {
                IConfigSource target = new IniConfigSource(targetFile);

                if (config.BreakOnNoMatch && !target.Configs[mod.section].Contains(mod.key))
                {
                    throw new Exception("Could not match section");
                }

                target.Configs[mod.section].Remove(mod.key);
                target.Save();
                LogCount(log);
            }
            catch (Exception inner)
            {
                throw new Exception("Failed to process Delete modification to Section/Key = " + mod.section + "/" + mod.key, inner);
            }
        }
        /// <summary>
        /// Applies any Delete modifications
        /// </summary>
        /// <param name="mod">The mod.</param>
        private void Delete(IniDelete mod)
        {
            try
            {
                IConfigSource target = new IniConfigSource(targetFile);

                if (config.BreakOnNoMatch && !target.Configs[mod.section].Contains(mod.key))
                {
                    throw new Exception("Could not match section");
                }

                target.Configs[mod.section].Remove(mod.key);
                target.Save();
                LogCount(log);
            }
            catch (Exception inner)
            {
                throw new Exception("Failed to process Delete modification to Section/Key = " + mod.section + "/" + mod.key, inner);
            }

        }