logo

FrmDownloader window, provides multifile download functions. More...

+ Inheritance diagram for NoteFly.FrmDownloader:

Public Member Functions

 FrmDownloader (string title)
 Initializes a new instance of the FrmDownloader class. More...
 
delegate void DownloadCompleetHandler (string[] newfiles)
 DownloadCompleet delegate More...
 
bool BeginDownload (string download, string storefolder)
 Begin downloading a file. More...
 
bool BeginDownload (string[] downloads, string storefolder)
 Begin downloading files. More...
 
int GetFileCompressedkind (string file)
 Find out what kind of compression on the file used. More...
 
bool DecompressZipFile (string zipfile, string[] extensionstodecompress)
 Decompress zip archive file. More...
 
bool DecompressGZipFile (string compressedfile)
 Decompress GZip single file. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used. More...
 

Events

DownloadCompleetHandler AllDownloadsCompleted
 Download is compleet event. More...
 

Private Member Functions

bool CreateWebclient ()
 Create a new webclient. More...
 
bool WebclientDownload (Uri uri)
 Let the webclient start asynchronized downloading of a file. More...
 
void SetFormTitle (string title)
 Set the title of this form. More...
 
void DownloadProcessChanged (object sender, ProgressChangedEventArgs e)
 Update download process. More...
 
void DownloadCompleted (object sender, AsyncCompletedEventArgs e)
 Webclient finished downloading a file. More...
 
string GetStoreFilepath (string url)
 Figure out the new file location based on the url and the folder where to save the file in. More...
 
void InitializeComponent ()
 Required method for Designer support - do not modify the contents of this method with the code editor. More...
 

Private Attributes

const string GZIPEXTENSION = ".gz"
 GZip extension More...
 
const string ZIPEXTENSION = ".zip"
 Zip extension More...
 
WebClient webclient
 Webclient object More...
 
int numdownloadscompleet = 0
 Number of downloads that FrmDownloader has compleeted. More...
 
string[] downloads
 The urls of all downloads to download. More...
 
List< string > files = new List<string>()
 List of all downloaded full file locations. More...
 
string storefolder = null
 The folder to save downloads to. More...
 
System.ComponentModel.IContainer components = null
 Required designer variable. More...
 
System.Windows.Forms.ProgressBar progressbarDownload
 ProgressBar progressbarDownload More...
 
System.Windows.Forms.Label lblStatusUpdate
 Label lblStatusUpdate More...
 

Detailed Description

Class to download and launch the update.

Constructor & Destructor Documentation

NoteFly.FrmDownloader.FrmDownloader ( string  title)
Parameters
titleTitle of the window

Member Function Documentation

bool NoteFly.FrmDownloader.BeginDownload ( string  download,
string  storefolder 
)
Parameters
downloadThe url of the file to download.
storefolderThe folder to save the file to.
Returns
True if started succesfully.
bool NoteFly.FrmDownloader.BeginDownload ( string[]  downloads,
string  storefolder 
)
Parameters
downloadsList of url of files to download.
storefolderThe folder to save all the files to.
Returns
True if downloading succesfully started.
bool NoteFly.FrmDownloader.CreateWebclient ( )
private
Returns
True if created succesfully.
bool NoteFly.FrmDownloader.DecompressGZipFile ( string  compressedfile)
Parameters
compressedfileThe compressed gzip file.
Returns
True if succeeded to decompress GZip file.
bool NoteFly.FrmDownloader.DecompressZipFile ( string  zipfile,
string[]  extensionstodecompress 
)
Parameters
zipfileThe zip file full filepath.
extensionstodecompressThe extension of file in the zipfile that are unzipped.
Returns
True if decompress zipfile succeeded.
override void NoteFly.FrmDownloader.Dispose ( bool  disposing)
protected
Parameters
disposingTrue if managed resources should be disposed; otherwise, false.
delegate void NoteFly.FrmDownloader.DownloadCompleetHandler ( string[]  newfiles)
Parameters
newfilesString array with all new files locations.
void NoteFly.FrmDownloader.DownloadCompleted ( object  sender,
AsyncCompletedEventArgs  e 
)
private
Parameters
senderThe sender object
eThe async. completed event arguments.
void NoteFly.FrmDownloader.DownloadProcessChanged ( object  sender,
ProgressChangedEventArgs  e 
)
private
Parameters
senderSender object
eProgressChangedEventArgs arguments
int NoteFly.FrmDownloader.GetFileCompressedkind ( string  file)
Parameters
fileThe compressed file
Returns
0 for not a know compressed file. 1 for a Zip file. 2 for GZip file.
string NoteFly.FrmDownloader.GetStoreFilepath ( string  url)
private
Parameters
urlThe url of the file to download.
Returns
The store path
void NoteFly.FrmDownloader.InitializeComponent ( )
private
void NoteFly.FrmDownloader.SetFormTitle ( string  title)
private
Parameters
titleThe new title prefix of this form
bool NoteFly.FrmDownloader.WebclientDownload ( Uri  uri)
private
Parameters
uriThe uri of the file to download.
Returns
True if download started succesfully.

Member Data Documentation

System.ComponentModel.IContainer NoteFly.FrmDownloader.components = null
private
string [] NoteFly.FrmDownloader.downloads
private
List<string> NoteFly.FrmDownloader.files = new List<string>()
private
const string NoteFly.FrmDownloader.GZIPEXTENSION = ".gz"
private
System.Windows.Forms.Label NoteFly.FrmDownloader.lblStatusUpdate
private
int NoteFly.FrmDownloader.numdownloadscompleet = 0
private
System.Windows.Forms.ProgressBar NoteFly.FrmDownloader.progressbarDownload
private
string NoteFly.FrmDownloader.storefolder = null
private
WebClient NoteFly.FrmDownloader.webclient
private
const string NoteFly.FrmDownloader.ZIPEXTENSION = ".zip"
private

Event Documentation

DownloadCompleetHandler NoteFly.FrmDownloader.AllDownloadsCompleted