C# Class AmazonScrape.PageManager

Manages the workload of one page of search results. Calls appropriate methods to load, parse, validate and return results to the SearchManager.
Inheritance: System.ComponentModel.BackgroundWorker
Afficher le fichier Open project: ThomasRush/AmazonScrape Class Usage Examples

Méthodes publiques

Méthode Description
PageManager ( int pageNumber, SearchCriteria criteria, Func pageLoadMethod, ProgressChangedEventHandler updateProgressMethod, RunWorkerCompletedEventHandler workerCompleteMethod ) : System

Creates and dispatches a PageManager to load a search page, parse, extract, validate and return results using the parameter callback EventHandlers

ToString ( ) : string

Outputs useful information about the PageManager

Work ( object sender, DoWorkEventArgs e ) : void

Loads, chops up, parses and validates one page worth of results.

Private Methods

Méthode Description
ParseAndValidateProductHtml ( string html ) : Result

Parses and validates a single product's html, returning a Result containing error messages or the valid AmazonItem

Method Details

PageManager() public méthode

Creates and dispatches a PageManager to load a search page, parse, extract, validate and return results using the parameter callback EventHandlers
public PageManager ( int pageNumber, SearchCriteria criteria, Func pageLoadMethod, ProgressChangedEventHandler updateProgressMethod, RunWorkerCompletedEventHandler workerCompleteMethod ) : System
pageNumber int Which search page number to load
criteria SearchCriteria The user's search criteria
pageLoadMethod Func Supply the method to retrieve html
updateProgressMethod ProgressChangedEventHandler Callback for progress updates
workerCompleteMethod RunWorkerCompletedEventHandler Callback when work complete
Résultat System

ToString() public méthode

Outputs useful information about the PageManager
public ToString ( ) : string
Résultat string

Work() public méthode

Loads, chops up, parses and validates one page worth of results.
public Work ( object sender, DoWorkEventArgs e ) : void
sender object
e System.ComponentModel.DoWorkEventArgs
Résultat void