Beispiel #1
0
        private static void ExpandMacros(ConfigurationMgr manager)
        {
            var macros = new List <MacroReplacement>();

            macros.Add(new MacroReplacement("$(ConfigRootPath)", manager.GlobalSection.ConfigRootPath));
            macros.Add(new MacroReplacement("$(InputRootPath)", manager.GlobalSection.InputRootPath));
            macros.Add(new MacroReplacement("$(OutputRootPath)", manager.GlobalSection.OutputRootPath));

            foreach (string section in manager.GetSectionNames())
            {
                foreach (MacroReplacement macro in macros)
                {
                    Section sec = manager.GetSection(section);
                    sec.ExpandMacro(macro);
                    sec.ExpandEnvVars();
                }
            }
        }