Beispiel #1
0
        internal void BuildConfigFilesFromMaster(string masterConfigFilename, IXmlLoaderSaver xmlLoaderSaver)
        {
            XDocument configDocument = xmlLoaderSaver.Load(masterConfigFilename);

            string baseConfigFilename = GetBaseConfigFilename(masterConfigFilename);

            var configuration = configDocument.Root;
            var generator = new ConfigurationGenerator(configuration);

            foreach (string environment in generator.Environments) {
                string outputFilename = GetEnvironmentOutputFilename(baseConfigFilename, environment);

                XDocument environmentConfig = new XDocument(generator.ConfigForEnvironment(environment));

                xmlLoaderSaver.Save(environmentConfig, outputFilename);
            }
        }
Beispiel #2
0
 public XDocument GenerateConfig(XDocument configDocument, string env, IDictionary<string, string> variables = null)
 {
     var confgen = new ConfigurationGenerator(configDocument.Root);
     var environmentConfig = new XDocument(confgen.ConfigForEnvironment(env, variables));
     return environmentConfig;
 }