public MainWindow() { Bet365Logger.Log("Bet365Monitor starting..."); InitializeComponent(); _mailSender = new MailSender(EmailSendingRetryTimeout, EmailSendingRetryCount); _driverGenerator = new DriverGenerator(WebPageUrlDk, SportDivClass, ChoosenSport, ChoosenLanguage, LeagueNameDivClass); _addedLeaguesProvider = new AddedLeaguesProvider(); _basketballLeaguesParser = new BasketballLeaguesParser(LeagueNameDivClass); _pagePinger = new PagePinger(_addedLeaguesProvider, _mailSender, _basketballLeaguesParser, WebPageUrlDk); _trigger = new MonitoringTrigger(_pagePinger, _driverGenerator, MonitoringTriggerRetryTimeout); _validEmailRegex = new Regex(ValidEmailPattern, RegexOptions.IgnoreCase); _disableElement.Add(EmailListBox); _disableElement.Add(EmailTextBox); _disableElement.Add(AddEmailButton); _disableElement.Add(RemoveEmailButton); _disableElement.Add(ClearEmailsButton); _disableElement.Add(LeaguesListBox); _disableElement.Add(LeagueTextBox); _disableElement.Add(AddLeagueButton); _disableElement.Add(RemoveLeagueButton); _disableElement.Add(ClearLeaguesButton); Bet365Logger.Log("Bet365Monitor successfully started."); }
public MonitoringTrigger(PagePinger pagePinger, DriverGenerator driverGenerator, int retryTimeout) { _retryTimeout = retryTimeout; _pagePinger = pagePinger; _isStarted = false; _lockObject = new object(); _driverGenerator = driverGenerator; _timer = new Timer(OnTimerPingCallback, _timer, Timeout.Infinite, Timeout.Infinite); }
public void AfterTests() { DriverGenerator.Quit(); }