private void bgWorker_Process_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     try
     {
         lblCurrentFile.Text = ProcessedFileCount.ToString() + " /  " + _RawFilesList.Count.ToString();
         if (ProcessingFile[0] != "0")
         {
             lblFileName1.Text = "FileName:" + Path.GetFileName(ProcessingFile[0]);
             lblStatus1.Text = ProcessingStatus[0];
             try
             {
                 progressBar1.Value = Convert.ToInt32(ProgressUpdate[ProcessingFile[0]] / (float)TotalScanNum[ProcessingFile[0]] * 100);
                 lblPercentage1.Text = (ProgressUpdate[ProcessingFile[0]] / (float)TotalScanNum[ProcessingFile[0]] * 100).ToString("00") + "%";
             }
             catch (Exception)
             {
                 progressBar1.Value = 0;
                 lblPercentage1.Text = "0%";
             }
         }
         else
         {
             lblFileName1.Text = "FileName:";
             lblStatus1.Text = "Status: Ready";
             progressBar1.Value = 0;
             lblPercentage1.Text = "0%";
         }
         if (ProcessingFile[1] != "0")
         {
             lblFileName2.Text = "FileName:" + Path.GetFileName(ProcessingFile[1]);
             lblStatus2.Text = ProcessingStatus[1];
             try
             {
                 progressBar2.Value = Convert.ToInt32(ProgressUpdate[ProcessingFile[1]] / (float)TotalScanNum[ProcessingFile[1]] * 100);
                 lblPercentage2.Text = (ProgressUpdate[ProcessingFile[1]] / (float)TotalScanNum[ProcessingFile[1]] * 100).ToString("00") + "%";
             }
             catch (Exception)
             {
                 progressBar2.Value = 0;
                 lblPercentage2.Text = "0%";
             }
         }
         else
         {
             lblFileName2.Text = "FileName:";
             lblStatus2.Text = "Status: Ready";
             progressBar2.Value = 0;
             lblPercentage2.Text = "0%";
         }
         if (ProcessingFile[2] != "0")
         {
             lblFileName3.Text = "FileName:" + Path.GetFileName(ProcessingFile[2]);
             lblStatus3.Text = ProcessingStatus[2];
             try
             {
                 progressBar3.Value = Convert.ToInt32(ProgressUpdate[ProcessingFile[2]] / (float)TotalScanNum[ProcessingFile[2]] * 100);
                 lblPercentage3.Text = (ProgressUpdate[ProcessingFile[2]] / (float)TotalScanNum[ProcessingFile[2]] * 100).ToString("00") + "%";
             }
             catch (Exception)
             {
                 progressBar3.Value = 0;
                 lblPercentage3.Text = "0%";
             }
         }
         else
         {
             lblFileName3.Text = "FileName:";
             lblStatus3.Text = "Status: Ready";
             progressBar3.Value = 0;
             lblPercentage3.Text = "0%";
         }
     }
     catch (Exception)
     {
         ErrMsg = ErrMsg + ("ErrMSG:" + e.ToString() + "\n");
     }
 }
Beispiel #2
0
 private void dowork1(object sender, ProgressChangedEventArgs e)
 {
     MessageBox.Show(e.ToString());
 }
Beispiel #3
0
 private void bwUpdateFiles_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     e.ToString();
     switch (e.ProgressPercentage)
     {
         case 1:
             sstriplblStatus.Text = e.UserState + ": Unpackaging the .zip update file.";
             break;
         case 2:
             sstriplblStatus.Text = e.UserState + ": Finding common directories.";
             break;
         case 3:
             sstriplblStatus.Text = e.UserState + ": Replacing files.";
             break;
         case 4:
             sstriplblStatus.Text = e.UserState + ": Replacing Windows only files";
             break;
         case 5:
             sstriplblStatus.Text = e.UserState + ": Compressing the backup files.";
             break;
         default:
             sstriplblStatus.Text = "Idle";
             break;
     }
 }