public HtmlSearchManager(string text, string url, int threadNumber) { _textToSearch = text; _url = url; _taskLimit = new LimitedConcurrencyLevelTaskScheduler(threadNumber); _taskFactory = new TaskFactory(_taskLimit); }
public HtmlSearchManager(string startUrl, string textToSearch, int numberOfUrlsToSearch, int threadNum, Output method) { _scheduler = new LimitedConcurrencyLevelTaskScheduler(threadNum); _startUrl = startUrl; _textToSearch = textToSearch; _numberOfUrlsToSearch = numberOfUrlsToSearch; _cancelTokenSource = new CancellationTokenSource(); _cancelToken = _cancelTokenSource.Token; _taskFactory = new TaskFactory(_cancelToken, TaskCreationOptions.None, TaskContinuationOptions.None, _scheduler); _outputMethod = method; }