Esempio n. 1
0
 void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
 {
     this.BeginInvoke((MethodInvoker) delegate {
         string downloaded      = FileSize.FormatBytes(e.BytesReceived);
         string toDownload      = FileSize.FormatBytes(e.TotalBytesToReceive);
         downloadLabel.Text     = "Downloaded " + downloaded + " of " + toDownload;
         downloadProgress.Value = int.Parse(e.ProgressPercentage.ToString());
     });
 }
Esempio n. 2
0
 private void SettingsForm_Load(object sender, EventArgs e)
 {
     this.propertiesName.Text = this.Text;
     if (this.Text.Replace(" Properties", "") == "CKPL Launcher")
     {
         this.uninstall.Enabled = false;
         this.diskUsage.Text    = FileSize.FormatBytes(FileSize.DirSize(new DirectoryInfo(Application.StartupPath)));
     }
     else
     {
         if (Directory.Exists(Application.StartupPath + "\\apps\\" + this.Text.Replace(" Properties", "")))
         {
             this.diskUsage.Text = FileSize.FormatBytes(FileSize.DirSize(new DirectoryInfo(Application.StartupPath + "\\apps\\" + this.Text.Replace(" Properties", ""))));
         }
         else
         {
             this.diskUsage.Text = "None";
             //this.uninstall.Enabled = false;
             this.browseGameFiles.Enabled = false;
         }
     }
 }