private async void timer_Elapsed(object sender, ElapsedEventArgs e) { _timer.Stop(); _newWebPage = new HtmlDocument(); _newWebPage.LoadHtml(HTMLMenager.GetHtmlPage(_item.Url)); MonitoredHistoryItem historyItem = CompareWebPages(); await SaveToDatabase(historyItem); if (historyItem.Type == 2) { await SendAlert(historyItem); } _timer.Start(); }
private bool PrepareDetection() { _oldWebPage = new HtmlDocument(); _oldWebPage.LoadHtml(HTMLMenager.GetHtmlPage(_item.Url)); if (_item.ElementName != "") { _oldNode = _oldWebPage.GetElementbyId(_item.ElementName); if (_oldNode == null) { MonitoredHistoryItem historyitem = new MonitoredHistoryItem(_item.MonitItemId); historyitem.SetTypeError("Cant find element on website "); SaveToDatabase(historyitem); // HistoryChange(this, myArg); return(false); } } return(true); }