Example #1
0
 protected virtual void OnProductParsed(ParserEventArgs args)
 {
     if (ProductParsed != null)
     {
         ProductParsed(this, args);
     }
 }
Example #2
0
 protected virtual void OnFoundProductLink(ParserEventArgs args)
 {
     if (FoundProductLink != null)
     {
         FoundProductLink(this, args);
     }
 }
Example #3
0
 protected virtual void OnFoundCategory(ParserEventArgs args)
 {
     if (FoundCategory != null)
     {
         FoundCategory(this, args);
     }
 }
 void target_FoundProductLink(object sender, ParserEventArgs e)
 {
     Trace.WriteLine(String.Format("Product link found: {0}",e.ProductLink));
       productCount++;
 }
 private void target_FoundCategory(object sender, ParserEventArgs e)
 {
     Trace.WriteLine(String.Format("Category found: {0} {1}", e.CategoryName, e.CategoryLink));
       categoryCount++;
 }
 void target_ProductParsed(object sender, ParserEventArgs e)
 {
     Trace.WriteLine(String.Format("Product parsed: {0}", e.Product.ToString()));
       ;
       Assert.IsNotNull(e.Product);
       Assert.IsTrue(!String.IsNullOrEmpty(e.Product.Name));
       Assert.IsTrue(!Double.IsNaN(e.Product.Price));
 }
Example #7
0
 protected override void OnFoundProductLink(ParserEventArgs args)
 {
     base.OnFoundProductLink(args);
 }
Example #8
0
 protected override void OnFoundCategory(ParserEventArgs args)
 {
     base.OnFoundCategory(args);
 }
Example #9
0
 protected virtual void OnProductParsed(ParserEventArgs args)
 {
     if (ProductParsed != null)
      ProductParsed(this, args);
 }
Example #10
0
 protected virtual void OnFoundProductLink(ParserEventArgs args)
 {
     if (FoundProductLink != null)
        FoundProductLink(this, args);
 }
Example #11
0
 protected virtual void OnFoundCategory(ParserEventArgs args)
 {
     if (FoundCategory != null)
        FoundCategory(this, args);
 }
Example #12
0
 void _parser_ProductParsed(object sender, ParserEventArgs e)
 {
     Products.Add(e.Product);
 }
Example #13
0
        void _parser_FoundProduct(object sender, ParserEventArgs e)
        {
            Trace.WriteLine(String.Format("Thread {0} Product found: {1} {2}", Thread.CurrentThread.ManagedThreadId, e.ParentCategoryId, e.ProductLink));

              var task = _factory.StartNew<HtmlDocument>(() => { return _client.Load(e.ProductLink); }).ContinueWith(
            (t) => _parser.ParseProductPage(t.Result, e.CategoryName));
        }
Example #14
0
        private void parser_FoundCategory(object sender, ParserEventArgs e)
        {
            Trace.WriteLine(String.Format("Thread {0} Category found: {1} {2}", Thread.CurrentThread.ManagedThreadId, e.CategoryName, e.CategoryLink));

            var task = _factory.StartNew<HtmlDocument>(() => { return _client.Load(e.CategoryLink); }).ContinueWith(
            (t) => _parser.ParseCategoryPage(t.Result, e.ParentCategoryId));

            _tasks.Add(task);
        }