Exemple #1
0
 public static void UpdateConfigFromFile(RuntimeConfigurationForGenerator runtimeConfiguration, string configFile)
 {
     using (TextReader file = new StreamReader(configFile))
     {
         UpdateConfigFromFileContent(runtimeConfiguration, file.ReadToEnd());
     }
 }
Exemple #2
0
        public static void UpdateConfigFromFileContent(RuntimeConfigurationForGenerator runtimeConfiguration, string configFileContent)
        {
            XmlDocument configDocument;

            try
            {
                configDocument = new XmlDocument();
                configDocument.LoadXml(configFileContent);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex, "Config load error");
                return;
            }

            var specFlowNode = configDocument.SelectSingleNode("/configuration/specFlow");

            if (specFlowNode == null)
            {
                return;
            }

            var section = ConfigurationSectionHandler.CreateFromXml(specFlowNode);

            runtimeConfiguration.UpdateFromConfigFile(section);
        }
 public SpecFlowProjectConfiguration()
 {
     GeneratorConfiguration = new GeneratorConfiguration();           // load defaults
     RuntimeConfiguration   = new RuntimeConfigurationForGenerator(); // load defaults
 }