예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 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));
     }
 }
예제 #4
0
 private void addConfigurationFromApplicationConfigFile(GraphLog log)
 {
     if (_pullConfigurationFromAppConfig)
     {
         log.Try(() =>
         {
             IList<XmlNode> appConfigNodes = StructureMapConfigurationSection.GetStructureMapConfiguration();
             foreach (XmlNode appConfigNode in appConfigNodes)
             {
                 IncludeNode(appConfigNode, String.Empty);
             }
         }).AndLogAnyErrors();
     }
 }