static void Main(string[] args) { try { Program.ValidateArgs(args); XmlDocument doc = Program.LoadConfiguration(args); ConfigurationFile config = new ConfigurationFile(doc); Driver driver = new Driver(config); driver.Drive(); if (config.IsOutputFile) { using (StreamWriter sr = new StreamWriter(config.OutputFile)) { OutputterFactory(config.OutputType, config.XmlStyleSheet).Output(sr, driver.Metrics, driver.Errors, true); } } else { OutputterFactory(config.OutputType, config.XmlStyleSheet).Output(System.Console.Out, driver.Metrics, driver.Errors, true); } } catch (Exception e) { Console.WriteLine(e.Message); PrintUsage(); } }
static void Main(string[] args) { try { Program.ValidateArgs(args); XmlDocument doc = Program.LoadConfiguration(args); ConfigurationFile config = new ConfigurationFile(doc); Driver driver = new Driver(config); driver.Drive(); OutputterFactory(config.OutputType).Output(driver.Metrics, driver.Errors, true); } catch (Exception e) { Console.WriteLine(e.Message); PrintUsage(); } }
static void Main(string[] args) { try { Program.ValidateArgs(args); XmlDocument doc = Program.LoadConfiguration(args); ConfigurationFile config = new ConfigurationFile(doc); Driver driver = new Driver(config); driver.Drive(); if (config.IsOutputFile) { using (StreamWriter sr = new StreamWriter(config.OutputFile)) { OutputterFactory(config.OutputType,config.XmlStyleSheet).Output(sr,driver.Metrics, driver.Errors, true); } } else { OutputterFactory(config.OutputType,config.XmlStyleSheet).Output(System.Console.Out,driver.Metrics, driver.Errors, true); } } catch (Exception e) { Console.WriteLine(e.Message); PrintUsage(); } }