Example #1
0
        private void bwDownload_DoWork(object sender, DoWorkEventArgs e)
        {
            var url     = string.Empty;
            var archive = string.Empty;

            try
            {
                if (bwDownload.CancellationPending)
                {
                    e.Cancel = true;
                    bwDownload.ReportProgress(0);
                    return;
                }

                var lst = (List <FileDownload>)e.Argument;
                foreach (var item in lst)
                {
                    if (bwDownload.CancellationPending)
                    {
                        e.Cancel = true;
                        bwDownload.ReportProgress(0);
                        return;
                    }
                    url     = item.Server;
                    archive = item.Tmp;
                    bwDownload.ReportProgress(0, item.Name);
                    Ext.CopyFile(item.Server, item.Tmp, AppConfig.Proxy, AppConfig.ProxyUrl, AppConfig.ProxyUserName, AppConfig.ProxyPassword);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message + "\n\nUrl: " + url + "\n\nTmp Archive: " + archive, ex);
            }
        }