Пример #1
0
 //The crawler takes a cache as parameter. The cache can be
 //either empty (starting url never crawled) or already full
 //with pages previously crawled - this is determined by the
 //content of the target directory.
 public Crawler(Cache cache, bool followExternalLinks)
 {
     _queue = new FetcherQueue(OnPageLoaded);
     _queue.ProcessingOver += () =>
     {
         if (WorkComplete != null)
         {
             WorkComplete();
         }
     };
     _cache = cache;
     _followExternalLinks = followExternalLinks;
 }
Пример #2
0
 //The crawler takes a cache as parameter. The cache can be
 //either empty (starting url never crawled) or already full
 //with pages previously crawled - this is determined by the
 //content of the target directory.
 public Crawler(Cache cache, bool followExternalLinks)
 {
     _queue = new FetcherQueue(OnPageLoaded);
     _queue.ProcessingOver += () =>
     {
         if (WorkComplete != null)
         {
             WorkComplete();
         }
     };
     _cache = cache;
     _followExternalLinks = followExternalLinks;
 }