private void LoadIncludes(Ini config) { { // check version Version ver = new Version(config.ReadSetting("csPublish", "Version")); if (LatestVersion.VersionIsNewer(ver, AssemblyVersionInfo.Program.AssemblyVersion)) { throw new Exception("Newer csPublish version required!"); } } string[] includes = config.ReadSection("include", true); if (includes.Length > 0) { config.RemoveSection("include"); foreach (string inc in includes) { Ini sub = new Ini(inc); LoadIncludes(sub); foreach (string section in sub.GetSectionNames()) { if (config.HasSection(section)) { throw new NotSupportedException(string.Format("Main configuration and included {0} contains a section with the name {1}.", Path.GetFileName(sub.Name), section)); } config.WriteSection(section, sub.ReadSection(section)); } } } }