public virtual void DownloadChapterAsync(ISemaphore semaphore, IChapterRecord chapter, string outputFolder, IDownloadFormatProvider formatProvider)
{
if (_backgroundWorker.IsBusy)
throw new InvalidOperationException("Download is currently in progress.");
if (semaphore == null)
throw new ArgumentNullException("semaphore");
if (chapter == null)
throw new ArgumentNullException("chapter");
if (String.IsNullOrEmpty(outputFolder))
throw new ArgumentException("Output folder must not be null or empty.", "outputFolder");
if (formatProvider == null)
throw new ArgumentNullException("formatProvider");
var workerParams = new WorkerParams()
{
Chapter = chapter,
Semaphore = semaphore,
OutputFolder = outputFolder,
FormatProvider = formatProvider
};
_backgroundWorker.RunWorkerAsync(workerParams);
}