C# Класс Nexus.Client.DownloadManagement.FileDownloadTask

Downloads a file.
Наследование: BackgroundTask, IDisposable
Показать файл Открыть проект Примеры использования класса

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

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

Cancels the task.

Dispose ( ) : void

Halts the file download.

After being disposed, that is no guarantee that the task's status will be correct. Further interaction with the object is undefined.

Download ( Uri p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName ) : void

Downloads the speificed file to the specified location.

This method starts the download, and waits for it to end. If the given p_strSavePath already exists, an attempt will be made to resume the download. If the pre-existing file is not a partial download, or the download cannot be resumed, the file will be overwritten.

DownloadAsync ( List p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName ) : void

Downloads the speificed file to the specified location.

This method starts the download and returns. If the given p_strSavePath already exists, an attempt will be made to resume the download. If the pre-existing file is not a partial download, or the download cannot be resumed, the file will be overwritten.

DownloadAsync ( Uri p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName ) : void

Downloads the speificed file to the specified location.

This method starts the download and returns. If the given p_strSavePath already exists, an attempt will be made to resume the download. If the pre-existing file is not a partial download, or the download cannot be resumed, the file will be overwritten.

FileDownloadTask ( IModRepository p_mmrModRepository, Int32 p_intMaxConnections, Int32 p_intMinBlockSize, string p_strUserAgent ) : System

A simple constructor that initializes the object with the given values.

Pause ( ) : void

Pauses the task.

Queue ( ) : void

Queues the task.

Resume ( ) : void

Resumes the task.

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

Метод Описание
Downloader_DownloadComplete ( object sender, CompletedDownloadEventArgs e ) : void

Handles the FileDownloader.DownloadComplete event of the file downloader.

This stops the updating of the progress properties.

Updater_Elapsed ( object sender, System.Timers.ElapsedEventArgs e ) : void

Handles the System.Timers.Timer.Elapsed event of the time that controls the updating of the progress properties.

This updates the progress properties.

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

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

Cancels the task.
public Cancel ( ) : void
Результат void

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

Halts the file download.
After being disposed, that is no guarantee that the task's status will be correct. Further interaction with the object is undefined.
public Dispose ( ) : void
Результат void

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

Downloads the speificed file to the specified location.
This method starts the download, and waits for it to end. If the given p_strSavePath already exists, an attempt will be made to resume the download. If the pre-existing file is not a partial download, or the download cannot be resumed, the file will be overwritten.
public Download ( Uri p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName ) : void
p_uriURL System.Uri The URL of the file to download.
p_dicCookies string>.Dictionary A list of cookies that should be sent in the request to download the file.
p_strSavePath string The path to which to save the file. /// If is false, this value should be a complete /// path, including filename. If is true, /// this value should be the directory in which to save the file.
p_booUseDefaultFileName bool Whether to use the file name suggested by the server.
Результат void

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

Downloads the speificed file to the specified location.
This method starts the download and returns. If the given p_strSavePath already exists, an attempt will be made to resume the download. If the pre-existing file is not a partial download, or the download cannot be resumed, the file will be overwritten.
public DownloadAsync ( List p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName ) : void
p_uriURL List The URL list of the file to download.
p_dicCookies string>.Dictionary A list of cookies that should be sent in the request to download the file.
p_strSavePath string The path to which to save the file. /// If is false, this value should be a complete /// path, including filename. If is true, /// this value should be the directory in which to save the file.
p_booUseDefaultFileName bool Whether to use the file name suggested by the server.
Результат void

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

Downloads the speificed file to the specified location.
This method starts the download and returns. If the given p_strSavePath already exists, an attempt will be made to resume the download. If the pre-existing file is not a partial download, or the download cannot be resumed, the file will be overwritten.
public DownloadAsync ( Uri p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName ) : void
p_uriURL System.Uri The URL of the file to download.
p_dicCookies string>.Dictionary A list of cookies that should be sent in the request to download the file.
p_strSavePath string The path to which to save the file. /// If is false, this value should be a complete /// path, including filename. If is true, /// this value should be the directory in which to save the file.
p_booUseDefaultFileName bool Whether to use the file name suggested by the server.
Результат void

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

A simple constructor that initializes the object with the given values.
public FileDownloadTask ( IModRepository p_mmrModRepository, Int32 p_intMaxConnections, Int32 p_intMinBlockSize, string p_strUserAgent ) : System
p_mmrModRepository IModRepository
p_intMaxConnections System.Int32 The maximum number of connections to use to download the file.
p_intMinBlockSize System.Int32 The minimum block size that should be downloaded at once. This should /// ideally be some mulitple of the available bandwidth.
p_strUserAgent string The current User Agent.
Результат System

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

Pauses the task.
Thrown if the task does not support pausing.
public Pause ( ) : void
Результат void

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

Queues the task.
Thrown if the task does not support queuing.
public Queue ( ) : void
Результат void

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

Resumes the task.
Thrown if the task is not paused.
public Resume ( ) : void
Результат void