C# Класс BiliRanking.Core.Download.MultiThreadedWebDownloader

Наследование: IDownloader
Показать файл Открыть проект

Открытые методы

Метод Описание
BeginDownload ( ) : void

Start to download.

BeginResume ( ) : void

Resume the download.

Cancel ( ) : void

Cancel the download

CheckUrl ( string &fileName ) : void

Check the Uri to find its size, and whether it supports "Pause".

CheckUrlAndFile ( string &fileName ) : void
Download ( ) : void

Start to download.

MultiThreadedWebDownloader ( string url ) : System

Download the whole file. The default buffer size is 1KB, memory cache is 1MB, buffer count per notification is 64, threads count is the double of logic processors count.

MultiThreadedWebDownloader ( string url, int bufferSize, int cacheSize, int bufferCountPerNotification, int maxThreadCount ) : System
Pause ( ) : void

Pause the download.

Resume ( ) : void

Resume the download.

Защищенные методы

Метод Описание
OnDownloadCompleted ( DownloadCompletedEventArgs e ) : void

Raise DownloadCompleted event.

OnDownloadProgressChanged ( DownloadProgressChangedEventArgs e ) : void

Raise DownloadProgressChanged event. If the status is Completed, then raise DownloadCompleted event.

OnStatusChanged ( EventArgs e ) : void

Raise StatusChanged event.

Приватные методы

Метод Описание
CheckFileOrCreateFile ( ) : void

Check whether the destination file exists. If not, create a file with the same size as the file to be downloaded.

DownloadInternal ( object obj ) : void
EnsurePropertyValid ( ) : void
client_DownloadCompleted ( object sender, DownloadCompletedEventArgs e ) : void

Handle the DownloadCompleted event of all the HttpDownloadClients.

client_DownloadProgressChanged ( object sender, DownloadProgressChangedEventArgs e ) : void

Handle the DownloadProgressChanged event of all the HttpDownloadClients, and calculate the download speed.

client_StatusChanged ( object sender, EventArgs e ) : void

Handle the StatusChanged event of all the HttpDownloadClients.

Описание методов

BeginDownload() публичный Метод

Start to download.
public BeginDownload ( ) : void
Результат void

BeginResume() публичный Метод

Resume the download.
public BeginResume ( ) : void
Результат void

Cancel() публичный Метод

Cancel the download
public Cancel ( ) : void
Результат void

CheckUrl() публичный Метод

Check the Uri to find its size, and whether it supports "Pause".
public CheckUrl ( string &fileName ) : void
fileName string
Результат void

CheckUrlAndFile() публичный Метод

public CheckUrlAndFile ( string &fileName ) : void
fileName string
Результат void

Download() публичный Метод

Start to download.
public Download ( ) : void
Результат void

MultiThreadedWebDownloader() публичный Метод

Download the whole file. The default buffer size is 1KB, memory cache is 1MB, buffer count per notification is 64, threads count is the double of logic processors count.
public MultiThreadedWebDownloader ( string url ) : System
url string
Результат System

MultiThreadedWebDownloader() публичный Метод

public MultiThreadedWebDownloader ( string url, int bufferSize, int cacheSize, int bufferCountPerNotification, int maxThreadCount ) : System
url string
bufferSize int
cacheSize int
bufferCountPerNotification int
maxThreadCount int
Результат System

OnDownloadCompleted() защищенный Метод

Raise DownloadCompleted event.
protected OnDownloadCompleted ( DownloadCompletedEventArgs e ) : void
e DownloadCompletedEventArgs
Результат void

OnDownloadProgressChanged() защищенный Метод

Raise DownloadProgressChanged event. If the status is Completed, then raise DownloadCompleted event.
protected OnDownloadProgressChanged ( DownloadProgressChangedEventArgs e ) : void
e DownloadProgressChangedEventArgs
Результат void

OnStatusChanged() защищенный Метод

Raise StatusChanged event.
protected OnStatusChanged ( EventArgs e ) : void
e System.EventArgs
Результат void

Pause() публичный Метод

Pause the download.
public Pause ( ) : void
Результат void

Resume() публичный Метод

Resume the download.
public Resume ( ) : void
Результат void