protected virtual void OnPollError(BaseBackgroundPoller poller, string area, string message) { }
protected virtual void OnNumberOfEntriesFound(BaseBackgroundPoller poller, Int32 numEntries) { }
protected virtual void OnPollDone(BaseBackgroundPoller poller, string message) { }
protected void OnEntryFound(BaseBackgroundPoller poller, EntryInfo info) { }
protected virtual void OnEntryParsed(BaseBackgroundPoller poller, EntryInfo info) { }
protected void OnPollError(BaseBackgroundPoller poller, string area, string message) { Logger.Instance.Log(message, area, LogType.ltError); }
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); }
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); } } }
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); }
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); } } }