예제 #1
0
        private void DownloadingPage_PageLoad(object sender, EventArgs e)
        {
            _rate.Reset(0);

            WizardForm.EnableBack = false;

            _client.DownloadStringAsync(InstallationInfo.ToolsInfoUri);
        }
예제 #2
0
        /////////////////////////////////
        // Download updated package

        private void DownloadPackage(String savePackageTo)
        {
            if (_updateInfo == null)
            {
                return;
            }

            WebClient client = new WebClient();

            client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
            client.DownloadFileCompleted   += new AsyncCompletedEventHandler(client_DownloadFileCompleted);

            _rate.Reset(0);

            client.DownloadFileAsync(_updateInfo.PackageLocation, savePackageTo, savePackageTo);
        }
예제 #3
0
        public void SetProgress(Int32 canonicalPercentage, Int64 complete, Int64 total)
        {
            if (canonicalPercentage == 0)
            {
                _calculator.Reset(total);
            }

            if (canonicalPercentage == -1)
            {
                __progress.Style = ProgressBarStyle.Marquee;
                return;
            }

            __progress.Style = ProgressBarStyle.Continuous;
            __progress.Value = canonicalPercentage;

            _calculator.Add(complete);
        }