protected void OnActionChanged(CrawlerState.Action oldAction, CrawlerState.Action newAction) { if (ActionChanged != null) { ActionChanged(this, new ActionChangedEventArgs(oldAction, newAction)); } }
public void Crawl(string rootTarget) { Exec.Start(ThreadName, () => { Root = rootTarget; _processed = new HashSet <string>(); TargetQueue.Enqueue(Root); string current; while (TargetQueue.TryDequeue(out current)) { Current = current; CurrentAction = CrawlerState.Action.Extracting; ExtractTargetsFromCurrentAndEnqueue(); CurrentAction = CrawlerState.Action.Processing; ProcessTarget(Current); _processed.Add(IsCaseSensitive ? Current : Current.ToLowerInvariant()); } CurrentAction = CrawlerState.Action.Idle; }); }
public ActionChangedEventArgs(CrawlerState.Action oldAction, CrawlerState.Action newAction) { this.OldAction = oldAction; this.NewAction = newAction; }