private void addConfigurationFromStructureMapConfig(ICollection<ConfigurationParser> list, GraphLog log) { if (_ignoreDefaultFile && !_useAndEnforceExistenceOfDefaultFile) return; // Pick up the configuration in the default StructureMap.config string pathToStructureMapConfig = GetStructureMapConfigurationPath(); if ((_useAndEnforceExistenceOfDefaultFile || File.Exists(pathToStructureMapConfig))) { log.Try(() => { ConfigurationParser parser = ConfigurationParser.FromFile(pathToStructureMapConfig); list.Add(parser); }).AndReportErrorAs(100, pathToStructureMapConfig); } }
private void addConfigurationFromExplicitlyAddedFiles(ICollection<ConfigurationParser> list, GraphLog log) { foreach (string filename in _otherFiles) { string absolutePath = locateFileAsAbsolutePath(filename); log.Try(() => { ConfigurationParser parser = ConfigurationParser.FromFile(absolutePath); parser.Description = absolutePath; list.Add(parser); }).AndReportErrorAs(160, absolutePath); } }
private void addConfigurationFromIncludeNodes(List<ConfigurationParser> list, GraphLog log) { foreach (ConfigurationParser parser in list.ToArray()) { parser.ForEachFile(log, filename => log.Try(() => { ConfigurationParser childParser = ConfigurationParser.FromFile(filename); list.Add(childParser); }) .AndReportErrorAs(150, filename)); } }
private void addConfigurationFromApplicationConfigFile(GraphLog log) { if (_pullConfigurationFromAppConfig) { log.Try(() => { IList<XmlNode> appConfigNodes = StructureMapConfigurationSection.GetStructureMapConfiguration(); foreach (XmlNode appConfigNode in appConfigNodes) { IncludeNode(appConfigNode, String.Empty); } }).AndLogAnyErrors(); } }