Ejemplo n.º 1
0
        private void Init()
        {
            OptionalUpdate = _localRelease.Compare(_remoteRelease.MinVersion) >= 0;
            lblTitle.Text  = string.Format(
                lblTitle.Text,
                _localRelease.ReleaseVersion,
                _remoteRelease.ReleaseVersion,
                _remoteRelease.ReleaseDate);
            try
            {
                if (_updateProxy != null)
                {
                    boxDes.Text = _updateProxy.GetUpdateLogBetweenVersion(_localRelease.ReleaseVersion,
                                                                          _remoteRelease.ReleaseVersion);
                }
                else
                {
                    boxDes.Text = _remoteRelease.UpdateDescription;
                }
            }
            catch
            {
                boxDes.Text = _remoteRelease.UpdateDescription;
            }
            _diff          = _localRelease.GetDifferences(_remoteRelease, out _totalSize);
            _totalSizeDesc = DownloadUtil.FormatFileSizeDescription(_totalSize);
            if (_diff == null || _totalSize == 0)
            {
                btnUpgrade.Text = _finishText;
                return;
            }

            progressBar1.Maximum = 100;
            if (!btnUpgrade.Enabled)
            {
                DoUpgrade();
            }
        }
Ejemplo n.º 2
0
 void WorkProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     progressBar1.Value = e.ProgressPercentage;
     //_downloadedSize += (long)e.UserState;
     lblSize.Text = string.Format("{0}/{1}", DownloadUtil.FormatFileSizeDescription(_downloadedSize), _totalSizeDesc);
 }