예제 #1
0
 protected virtual void OnPollError(BaseBackgroundPoller poller, string area, string message)
 {
 }
예제 #2
0
 protected virtual void OnNumberOfEntriesFound(BaseBackgroundPoller poller, Int32 numEntries)
 {
 }
예제 #3
0
 protected virtual void OnPollDone(BaseBackgroundPoller poller, string message)
 {
 }
예제 #4
0
 protected void OnEntryFound(BaseBackgroundPoller poller, EntryInfo info)
 {
 }
예제 #5
0
 protected virtual void OnEntryParsed(BaseBackgroundPoller poller, EntryInfo info)
 {
 }
예제 #6
0
 protected void OnPollError(BaseBackgroundPoller poller, string area, string message)
 {
     Logger.Instance.Log(message, area, LogType.ltError);
 }
예제 #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);
 }
예제 #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);
         }
     }
 }
예제 #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);
        }
예제 #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);
         }
     }
     
 }