public void registerCrawlerProcessInformation(CrawlerProcessInformation crawlerProcessInformation) { if (crawlerProcessInformation != null) { crawlerProcessInformation.crawlerProcessInformationUpdateEvent += new CrawlerProcessInformationUpdateEvent(this.crawlerProcessInformation_UpdateEvent); crawlerProcessInformation.crawlerProcessInformationNewImageEvent += new CrawlerProcessInformationNewImageEvent(this.crawlerProcessInformation_crawlerProcessInformationNewImageEvent); this.determineProcessInformationActiveState(crawlerProcessInformation); } }
private void triggerCrawlerJobViewUpdateEventAddedNewProcessInformation(CrawlerProcessInformation crawlerProcessInformation) { if (crawlerJobViewUpdateEventAddedNewProcessInformation != null) { lock (crawlerProcessInformation) { crawlerJobViewUpdateEventAddedNewProcessInformation(crawlerProcessInformation); } } }
private void crawlerProcessInformation_UpdateEvent(CrawlerProcessInformation crawlerProcessInformation) { this.determineProcessInformationActiveState(crawlerProcessInformation); lock (crawlerProcessInformation) { if (this.updateProcessInformationEvent != null) { this.updateProcessInformationEvent(crawlerProcessInformation); } } }
private void determineProcessInformationActiveState(CrawlerProcessInformation crawlerProcessInformation) { if (crawlerProcessInformation != null) { lock (this.activeCrawlerProcessInformationList) { if (crawlerProcessInformation.isActiveProcess()) { if (!this.activeCrawlerProcessInformationList.Contains(crawlerProcessInformation)) { // this.activeCrawlerProcessInformationList.Add(crawlerProcessInformation); this.triggerCrawlerJobViewUpdateEventAddedNewProcessInformation(crawlerProcessInformation); this.triggerCrawlerJobViewUpdateEventProcessInformationList(); } } else { if (this.activeCrawlerProcessInformationList.Contains(crawlerProcessInformation)) { // this.activeCrawlerProcessInformationList.Remove(crawlerProcessInformation); this.triggerCrawlerJobViewUpdateEventProcessInformationList(); } } } lock (this.allOccurredCrawlerProcessInformationList) { if (!this.allOccurredCrawlerProcessInformationList.Contains(crawlerProcessInformation)) { this.allOccurredCrawlerProcessInformationList.Add(crawlerProcessInformation); } } } }