Exemplo n.º 1
0
 protected virtual void OnPollError(BaseBackgroundPoller poller, string area, string message)
 {
 }
Exemplo n.º 2
0
 protected virtual void OnNumberOfEntriesFound(BaseBackgroundPoller poller, Int32 numEntries)
 {
 }
Exemplo n.º 3
0
 protected virtual void OnPollDone(BaseBackgroundPoller poller, string message)
 {
 }
Exemplo n.º 4
0
 protected void OnEntryFound(BaseBackgroundPoller poller, EntryInfo info)
 {
 }
Exemplo n.º 5
0
 protected virtual void OnEntryParsed(BaseBackgroundPoller poller, EntryInfo info)
 {
 }
Exemplo n.º 6
0
 protected void OnPollError(BaseBackgroundPoller poller, string area, string message)
 {
     Logger.Instance.Log(message, area, LogType.ltError);
 }
Exemplo n.º 7
0
 protected void OnPollDone(BaseBackgroundPoller poller, string message)
 {
     List<string> lastFiveSearched = null;
     if (!areaLastFiveSearched.TryGetValue(poller.PollerAreaDetails, out lastFiveSearched))
     {
         if(lastFiveSearched.Count > 5)
             lastFiveSearched.RemoveRange(5, lastFiveSearched.Count - 5);
     }
     Logger.Instance.Log(message, poller.PollerAreaDetails.City, LogType.ltArea);
 }
Exemplo n.º 8
0
 protected void OnEntryParsed(BaseBackgroundPoller poller, EntryInfo info)
 {
     if (this.wbEntries.InvokeRequired)
         this.wbEntries.Invoke(new MethodInvoker(delegate() { OnEntryParsed(poller, info); }));
     else
     {
         try
         {
             string body = info.Body.ToLower();
             string title = info.Title.ToLower();
             foreach (string key in keywords)
             {
                 if (body.Contains(key) || title.Contains(key))
                 {
                     string output = String.Format(CLWTabPage.entryFormat, info.ToString());
                     this.wbEntries.Document.Write(output);
                     if (this.wbEntries.Document.Body != null)
                         this.wbEntries.Document.Window.ScrollTo(0, this.wbEntries.Document.Body.ScrollRectangle.Bottom);
                     Application.DoEvents();
                     UpdateEntriesFound();
                     break;
                 }
             }
             UpdateEntriesSearched();
         }
         catch (System.Exception ex)
         {
             Logger.Instance.Log(ex.ToString() + ": " + info, LogType.ltError);
         }
     }
 }
Exemplo n.º 9
0
        protected void OnEntryFound(BaseBackgroundPoller poller, EntryInfo info)
        {
            List<string> lastFiveSearched = null;
            if (!areaLastFiveSearched.TryGetValue(poller.PollerAreaDetails, out lastFiveSearched) || lastFiveSearched.Contains(info.URL))
            {
                poller.EntryFound -= this._entryFoundHandler;
                return;
            }

            lastFiveSearched.Insert(0, info.URL);
        }
Exemplo n.º 10
0
 protected void OnNumberOfEntriesFound(BaseBackgroundPoller poller, Int32 numEntries)
 {
     if (this.lblTotalEntries.InvokeRequired)
         this.lblTotalEntries.Invoke(new MethodInvoker(delegate() { OnNumberOfEntriesFound(poller, numEntries); }));
     else
     {
         try
         {
             if (!areaLastFiveSearched.Keys.Contains(poller.PollerAreaDetails))
                 return;
             this.lblTotalEntries.Text = "Total Entries: " + (totalEntries += numEntries).ToString();
         }
         catch (System.Exception ex)
         {
             Logger.Instance.Log(ex.ToString(), LogType.ltError);
         }
     }
     
 }