Exemple #1
0
        private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
        {
            // Calculate download speed
            String downloadSpeed = Patcher.BytesToString(e.BytesReceived / this.sw.Elapsed.TotalSeconds);

            // Show the percentage on our label.
            int percentage = e.ProgressPercentage;

            // Update the label with how much data have been downloaded so far and the total size of the file we are currently downloading
            String totalReceived = string.Format("{0} MB / {1} MB", (e.BytesReceived / 1024d / 1024d).ToString("0.00"), (e.TotalBytesToReceive / 1024d / 1024d).ToString("0.00"));

            this.setStatusText(string.Format("{0} Downloading: {1} {2} ", this.currentFileProcessing(), Path.GetFileNameWithoutExtension(this.currentDownload), totalReceived), downloadSpeed);
            this.setProgressbar(percentage);
        }
Exemple #2
0
        private void GameLauncher_Load(object sender, EventArgs e)
        {
            DrawControlBackground(this.btnClose, false);
            DrawControlBackground(this.btnStartGame, false);
            DrawControlBackground(this.lblStatusText, false);
            UpdateLayeredBackground();

            //For convenience when switching between the on / off images
            m_closeBtnOff = this.btnClose.Image;
            m_closeBtnOn  = this.btnClose.BackgroundImage;

            m_BtnGameStartOff = this.btnStartGame.Image;
            m_BtnGameStartOn  = this.btnStartGame.BackgroundImage;

            this.oPatcher = new Patcher(this);
        }