C# 클래스 AmazonScrape.SearchManager

Manages the logical workflow of the application. Creates and deploys PageManagers. Returns WorkProgress object to report status and successful results.
상속: System.ComponentModel.BackgroundWorker
파일 보기 프로젝트 열기: ThomasRush/AmazonScrape 1 사용 예제들

공개 메소드들

메소드 설명
GetPercentComplete ( ) : int

Returns integer percentage of overall progress, based on the number of retrieved and validated results.

ResultReturned ( object obj, ProgressChangedEventArgs args ) : void

Called by the PageManagers whenever they have a result. Returns the result back to the UI. Also checks and stops work if finished.

SearchManager ( SearchCriteria searchCriteria, int threadCount ) : System

Create and start work on a new search. Spawns PageManagers.

WorkerFinished ( object obj, RunWorkerCompletedEventArgs args ) : void

Called by PageManagers when their task is complete. If there is still work to be done, replaces the finished pageManager with a new one (creates a new thread) Exits if all work is complete.

비공개 메소드들

메소드 설명
HaltAllOngoingWork ( ) : void

Stops and disposes all PageManager threads and marks the main search as finished working

IsWorkFinished ( ) : bool

True if the search was cancelled, we've reached 100% of the desired number of results, or all of the threads are finished

OutputPageManagerStatus ( ) : void

Write PageManager WorkStatus to console for debugging

Work ( object sender, DoWorkEventArgs e ) : void

Sets up PageManager threads and begin search

메소드 상세

GetPercentComplete() 공개 메소드

Returns integer percentage of overall progress, based on the number of retrieved and validated results.
public GetPercentComplete ( ) : int
리턴 int

ResultReturned() 공개 메소드

Called by the PageManagers whenever they have a result. Returns the result back to the UI. Also checks and stops work if finished.
public ResultReturned ( object obj, ProgressChangedEventArgs args ) : void
obj object sender object
args System.ComponentModel.ProgressChangedEventArgs Result
리턴 void

SearchManager() 공개 메소드

Create and start work on a new search. Spawns PageManagers.
public SearchManager ( SearchCriteria searchCriteria, int threadCount ) : System
searchCriteria SearchCriteria User-supplied search criteria
threadCount int Number of pages to search asynchronously
리턴 System

WorkerFinished() 공개 메소드

Called by PageManagers when their task is complete. If there is still work to be done, replaces the finished pageManager with a new one (creates a new thread) Exits if all work is complete.
public WorkerFinished ( object obj, RunWorkerCompletedEventArgs args ) : void
obj object sender object
args System.ComponentModel.RunWorkerCompletedEventArgs Result
리턴 void