private void HTMLDocumentCompare()
 {
     if (_oldWebPage.DocumentNode != _newWebPage.DocumentNode)
     {
         _oldWebPage = _newWebPage;
         DetectorArgs myArgs = new DetectorArgs("something on website changes");
         HistoryChange(this, myArgs);
         OnWebsiteChange(this, myArgs);
     }
     else
     {
         DetectorArgs myArgs = new DetectorArgs("no changes on website ");
         HistoryChange(this, myArgs);
     }
 }
 private String GetHtmlPage()
 {
     try
     {
         HttpWebRequest  request  = (HttpWebRequest)WebRequest.Create(_url);
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();
         StreamReader    source   = new StreamReader(response.GetResponseStream());
         return(source.ReadToEnd());
     }
     catch (Exception ex)
     {
         DetectorArgs myArgs = new DetectorArgs("I can't check page. No internet");
         HistoryChange(this, myArgs);
         return("");
     }
 }
 public void StartDetection()
 {
     _oldWebPage = new HtmlDocument();
     _oldWebPage.LoadHtml(GetHtmlPage());
     if (_elementName != "")
     {
         _oldNode = _oldWebPage.GetElementbyId(_elementName);
         if (_oldNode == null)
         {
             DetectorArgs myArg = new DetectorArgs("Cant find element on website ");
             HistoryChange(this, myArg);
         }
     }
     _timer          = new DispatcherTimer();
     _timer.Tick    += timer_Tick;
     _timer.Interval = new TimeSpan(0, _freq, 0);
     _timer.Start();
 }
 private void HTMLNodeCompare()
 {
     if (_oldNode != null && _newNode != null)
     {
         if (_oldNode.OuterHtml != _newNode.OuterHtml)
         {
             _oldNode = _newNode;
             DetectorArgs myArgs = new DetectorArgs("Your node changes");
             HistoryChange(this, myArgs);
             OnWebsiteChange(this, myArgs);
         }
         else
         {
             DetectorArgs myArgs = new DetectorArgs("no changes on website ");
             HistoryChange(this, myArgs);
         }
     }
     else
     {
         DetectorArgs myArg = new DetectorArgs("Cant find element on website ");
         HistoryChange(this, myArg);
     }
 }