C# Класс FileDownloaderApp.FileDownloader

Class for downloading files in the background that supports info about their progress, the total progress, cancellation, pausing, and resuming. The downloads will run on a separate thread so you don't have to worry about multihreading yourself.
Class FileDownloader v1.0.2, by De Dauw Jeroen - April 2009
Наследование: System.Object, IDisposable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CurrentFilePercentage ( ) : Double

Gets the percentage of the current file progress

CurrentFilePercentage ( Int32 decimals ) : Double

Gets the percentage of the current file progress

Dispose ( ) : void
FileDownloader ( ) : System

Create a new instance of a FileDownloader

FileDownloader ( System.Boolean supportsProgress ) : System

Create a new instance of a FileDownloader

FormatSizeBinary ( System.Int64 size ) : string

Format an amount of bytes to a more readible notation with binary notation symbols

FormatSizeBinary ( System.Int64 size, Int32 decimals ) : string

Format an amount of bytes to a more readible notation with binary notation symbols

FormatSizeDecimal ( System.Int64 size ) : string

Format an amount of bytes to a more readible notation with decimal notation symbols

FormatSizeDecimal ( System.Int64 size, Int32 decimals ) : string

Format an amount of bytes to a more readible notation with decimal notation symbols

Pause ( ) : void
Resume ( ) : void
Start ( ) : void
Stop ( ) : void
Stop ( System.Boolean deleteCompletedFiles ) : void
TotalPercentage ( ) : Double

Gets the total download percentage. Only avaible when the FileDownloader suports progress

TotalPercentage ( Int32 decimals ) : Double

Gets the total download percentage. Only avaible when the FileDownloader suports progress

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

Метод Описание
Dispose ( System.Boolean disposing ) : void

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

Метод Описание
bgwDownloader_DoWork ( object sender, DoWorkEventArgs e ) : void
bgwDownloader_ProgressChanged ( object sender, ProgressChangedEventArgs e ) : void
bgwDownloader_RunWorkerCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void
calculateFilesSize ( ) : void
cleanUpFiles ( Int32 start, Int32 length ) : void
downloadFile ( Int32 fileNr ) : void
fireEventFromBgw ( Event eventName ) : void
initizalize ( System.Boolean supportsProgress ) : void

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

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

Gets the percentage of the current file progress
public CurrentFilePercentage ( ) : Double
Результат Double

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

Gets the percentage of the current file progress
public CurrentFilePercentage ( Int32 decimals ) : Double
decimals System.Int32
Результат Double

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

public Dispose ( ) : void
Результат void

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

protected Dispose ( System.Boolean disposing ) : void
disposing System.Boolean
Результат void

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

Create a new instance of a FileDownloader
public FileDownloader ( ) : System
Результат System

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

Create a new instance of a FileDownloader
public FileDownloader ( System.Boolean supportsProgress ) : System
supportsProgress System.Boolean Optional. Boolean. Should the FileDownloader support total progress statistics?
Результат System

FormatSizeBinary() публичный статический Метод

Format an amount of bytes to a more readible notation with binary notation symbols
public static FormatSizeBinary ( System.Int64 size ) : string
size System.Int64 Required. Int64. The raw amount of bytes
Результат string

FormatSizeBinary() публичный статический Метод

Format an amount of bytes to a more readible notation with binary notation symbols
public static FormatSizeBinary ( System.Int64 size, Int32 decimals ) : string
size System.Int64 Required. Int64. The raw amount of bytes
decimals System.Int32 Optional. Int32. The amount of decimals you want to have displayed in the notation
Результат string

FormatSizeDecimal() публичный статический Метод

Format an amount of bytes to a more readible notation with decimal notation symbols
public static FormatSizeDecimal ( System.Int64 size ) : string
size System.Int64 Required. Int64. The raw amount of bytes
Результат string

FormatSizeDecimal() публичный статический Метод

Format an amount of bytes to a more readible notation with decimal notation symbols
public static FormatSizeDecimal ( System.Int64 size, Int32 decimals ) : string
size System.Int64 Required. Int64. The raw amount of bytes
decimals System.Int32 Optional. Int32. The amount of decimals you want to have displayed in the notation
Результат string

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

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

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

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

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

public Start ( ) : void
Результат void

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

public Stop ( ) : void
Результат void

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

public Stop ( System.Boolean deleteCompletedFiles ) : void
deleteCompletedFiles System.Boolean
Результат void

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

Gets the total download percentage. Only avaible when the FileDownloader suports progress
public TotalPercentage ( ) : Double
Результат Double

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

Gets the total download percentage. Only avaible when the FileDownloader suports progress
public TotalPercentage ( Int32 decimals ) : Double
decimals System.Int32
Результат Double