コード例 #1
0
 private static string FormatProgressText(long completed, long total)
 {
     return(string.Format((IFormatProvider)CultureInfo.CurrentUICulture, Resources.GetString("UI_ProgressText"), new object[2]
     {
         (object)ProgressPiece.FormatBytes(completed),
         (object)ProgressPiece.FormatBytes(total)
     }));
 }
コード例 #2
0
        private void UpdateUI()
        {
            if (this.IsDisposed)
            {
                return;
            }
            this.SuspendLayout();
            this.lblProgressText.Text = ProgressPiece.FormatProgressText(this._downloadData.BytesCompleted, this._downloadData.BytesTotal);
            this.progress.Minimum     = 0;
            long bytesTotal = this._downloadData.BytesTotal;
            int  num1;
            int  num2;

            if (bytesTotal > (long)int.MaxValue)
            {
                num1 = (int)((double)this._downloadData.BytesCompleted / (double)((float)bytesTotal / (float)int.MaxValue));
                num2 = int.MaxValue;
            }
            else
            {
                num1 = (int)this._downloadData.BytesCompleted;
                num2 = (int)bytesTotal;
            }
            this.progress.Maximum = num2;
            this.progress.Value   = num1;
            this.FindForm().Text  = string.Format((IFormatProvider)CultureInfo.CurrentUICulture, Resources.GetString("UI_ProgressTitle"), new object[2]
            {
                (object)this._downloadData.Progress,
                (object)this._info.formTitle
            });
            if (!this._appIconShown && this._appIconBitmap != null)
            {
                this.pictureAppIcon.Image = (Image)this._appIconBitmap;
                this._appIconShown        = true;
            }
            this.ResumeLayout(false);
        }