Exemple #1
0
        private static async Task Main()
        {
            IGetSettings set = Factory.CreateGetSettings();

            (List <string> lotteryFile, List <JObject> lotteryJObject, var scrapeWebsites) =
                await set.RetrieveSettings();

            (List <string> LotteryFile, List <JObject> LotteryJObject)lotteryInfo = (lotteryFile, lotteryJObject);

            IValidateLottoLists validateLists = Factory.CreateValidateLottoLists();
            await validateLists.ValidateLotteryLists(lotteryInfo);



            // If true: Uses Quartz.net to schedule tasks.
            // TODO: Check against settings file to see which website scraping tasks need to be scheduled.
            if (scrapeWebsites)
            {
                Console.WriteLine("ScrapeWebsites = True");

                var props = new NameValueCollection
                {
                    { "quartz.serializer.type", "binary" }
                };
                var quartzFactory = new StdSchedulerFactory(props);

                IScheduler scheduler = await quartzFactory.GetScheduler();

                await scheduler.Start();

                await Lotto649Schedule.Lotto649Scheduler(scheduler);

                await LottoMaxSchedule.LottoMaxScheduler(scheduler);

                await USPowerballSchedule.USPowerballScheduler(scheduler);
            }

            //Console.ReadKey();

            while (true)
            {
            }
        }
 /// <summary>
 ///     Uses validateLottoList to start the new frequency calculation for the just-scrapped lottery.
 /// </summary>
 /// <param name="validateLottoList"></param>
 public BeginRecalculation(IValidateLottoLists validateLottoList)
 {
     _validateLottoList = validateLottoList;
 }