Пример #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);
         }
     }
     
 }