private void BackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { BackgroundWorkerStatus status = (BackgroundWorkerStatus)e.UserState; if (status != null && status.Status1 != null) { lblBackupStatus1.Text = status.Status1; } if (status != null && status.Status2 != null) { lblBackupStatus2.Text = status.Status2; } runBackupNowToolStripMenuItem.Enabled = true; stopBackupToolStripMenuItem.Enabled = false; lstIncludes.Enabled = true; lstExcludes.Enabled = true; butIncludeAddFile.Enabled = true; butIncludeAddFolder.Enabled = true; butIncludeDelete.Enabled = true; butExcludeAddFile.Enabled = true; butExcludeAddFolder.Enabled = true; butExcludeAddText.Enabled = true; butExcludeDelete.Enabled = true; butDestinationBrowse.Enabled = true; chkRunEvery.Enabled = true; txtRunEvery.Enabled = true; radRunEveryDays.Enabled = true; radRunEveryHours.Enabled = true; radRunEveryMinutes.Enabled = true; backgroundWorker = null; }
private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { BackgroundWorkerStatus status = (BackgroundWorkerStatus)e.UserState; if (status != null && status.Status1 != null) { lblBackupStatus1.Text = status.Status1; } if (status != null && status.Status2 != null) { lblBackupStatus2.Text = status.Status2; } }