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

Downloads pieces of a file until the entire file is downloaded, or instructed to stop.
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5

공개 메소드들

메소드 설명
BlockDownloader ( FileDownloader p_fdrFileDownloader, FileMetadata p_fmdInfo, FileWriter p_fwrWriter, Int32 p_intBufferSize, string p_strUserAgent ) : System

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

Start ( ) : void

Starts the file download.

After a block has finished downloading, a new block will be requested for download. this will continue until no blocks are left, or told to stop.

Stop ( ) : void

Instructs the downloader to stop.

비공개 메소드들

메소드 설명
DoStart ( ) : void

This method gets the next block to download, and downloads it. This loops until there are no more blocks, or we are told to stop.

This method is run on a thread.

DownloadBlock ( Range p_rngBlockToDownload ) : void

Downloads the specified block.

FileWriter_UnableToWrite ( object sender, EventArgs e ) : void

Handles the FileWriter.UnableToWrite events of the FileWriters being used.

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

메소드 상세

BlockDownloader() 공개 메소드

A simple constructor that initializes the object with the given values.
public BlockDownloader ( FileDownloader p_fdrFileDownloader, FileMetadata p_fmdInfo, FileWriter p_fwrWriter, Int32 p_intBufferSize, string p_strUserAgent ) : System
p_fdrFileDownloader FileDownloader The from which to retrieve the block this /// downloader will download.
p_fmdInfo FileMetadata The metadata of the to be downloaded.
p_fwrWriter FileWriter The writer to use to write the file to the disk.
p_intBufferSize System.Int32 The size of the buffer to send to the file writer.
p_strUserAgent string The current User Agent.
리턴 System

Start() 공개 메소드

Starts the file download.
After a block has finished downloading, a new block will be requested for download. this will continue until no blocks are left, or told to stop.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Instructs the downloader to stop.
public Stop ( ) : void
리턴 void