C# 클래스 Nexus.Client.Util.Downloader.FileDownloader

Downloads a file.
This downloader uses multiple connections to download the file. It also supports resuming interrupted downloads.
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5 1 사용 예제들

공개 메소드들

메소드 설명
Cleanup ( ) : void

Cleans up the meta files used while downloading.

FileDownloader ( Uri p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName, Int32 p_intMaxConnections, Int32 p_intMinBlockSize, string p_strUserAgent ) : System

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

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.

StartDownload ( ) : void

Starts the file download.

Stop ( ) : void

Stops the file download.

보호된 메소드들

메소드 설명
GetMetadata ( ) : FileMetadata

Gets the file's metadata.

GetNextBlock ( ) : Range

Gets the next block in the file that needs to be downloaded.

OnDownloadComplete ( CompletedDownloadEventArgs e ) : void

Raises the DownloadComplete event.

A completed download does not mean the entire file has been downloaded; the download may have been interrupted.

OnDownloadComplete ( bool p_booGotEntireFile, string p_strSavedFileName ) : void

Raises the DownloadComplete event.

A completed download does not mean the entire file has been downloaded; the download may have been interrupted.

비공개 메소드들

메소드 설명
Downloader_FinishedDownloading ( object sender, EventArgs e ) : void

Handles the BlockDownloader.FinishedDownloading events of the BlockDownloaders being used.

This stops the file download once all the BlockDownloaders have finished.

Initialize ( string p_strSavePath, bool p_booUseDefaultFileName ) : void

Sets up the initial values of the downloader.

메소드 상세

Cleanup() 공개 메소드

Cleans up the meta files used while downloading.
public Cleanup ( ) : void
리턴 void

FileDownloader() 공개 메소드

A simple constructor that initializes the object with the given values.
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 FileDownloader ( Uri p_uriURL, string>.Dictionary p_dicCookies, string p_strSavePath, bool p_booUseDefaultFileName, Int32 p_intMaxConnections, Int32 p_intMinBlockSize, string p_strUserAgent ) : System
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.
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

GetMetadata() 보호된 메소드

Gets the file's metadata.
protected GetMetadata ( ) : FileMetadata
리턴 FileMetadata

GetNextBlock() 보호된 메소드

Gets the next block in the file that needs to be downloaded.
protected GetNextBlock ( ) : Range
리턴 Range

OnDownloadComplete() 보호된 메소드

Raises the DownloadComplete event.
A completed download does not mean the entire file has been downloaded; the download may have been interrupted.
protected OnDownloadComplete ( CompletedDownloadEventArgs e ) : void
e CompletedDownloadEventArgs A describing the event arguments.
리턴 void

OnDownloadComplete() 보호된 메소드

Raises the DownloadComplete event.
A completed download does not mean the entire file has been downloaded; the download may have been interrupted.
protected OnDownloadComplete ( bool p_booGotEntireFile, string p_strSavedFileName ) : void
p_booGotEntireFile bool Whether the entire file has been downloaded.
p_strSavedFileName string The path to the downloaded file.
리턴 void

StartDownload() 공개 메소드

Starts the file download.
public StartDownload ( ) : void
리턴 void

Stop() 공개 메소드

Stops the file download.
public Stop ( ) : void
리턴 void