Example #1
0
 static void Main(string[] args)
 {
     var options = new CommandLineOptions();
     if (Parser.Default.ParseArguments(args, options))
     {
         DownloadQuotes(options);
     }
 }
Example #2
0
 private static void DownloadQuotes(CommandLineOptions options)
 {
     var kernel = new StandardKernel(new DownloaderModule(options));
     ContractSpecification contractSpecification;
     var service = kernel.Get<IService>();
     service.Download += Inform;
     IEnumerable<Market> markets;
     if (options.Symbol.ToLowerInvariant() == "all")
     {
         markets = service.GetWeeklyDataForAllSymbols();
     }
     else if (ContractSpecification.TryParse(options.Symbol, out contractSpecification))
     {
         markets = new Market(contractSpecification, service.GetWeeklyData(contractSpecification.Symbol)).AsCollection();
     }
     else
     {
         WriteWrongMarketMessage();
         return;
     }
     kernel.Get<FormatterFactory>().Create().Format(markets);
 }
Example #3
0
 public DownloaderModule(CommandLineOptions options)
 {
     _options = options;
 }