protected virtual void OnBackupProgress(BackupEventArgs e) { if (BackupProgress != null) { BackupProgress(this, e); } }
private void Bm_BackupProgress(object sender, BackupEventArgs e) { if (e.State == BackupState.ResettingAppData2) { progressText.Text = "Removing files " + e.Message; } else { progressText.Text = "Finalizing..."; } }
private void BackupManager_BackupProgress(object sender, BackupEventArgs e) { if ((e.State == BackupState.Compressing) && ((DateTime.Now - lastUpdate) < TimeSpan.FromMilliseconds(100))) { return; } if ((e.State == BackupState.ResettingAppData2) || (e.State == BackupState.Finalizing2)) { progressBar1.IsIndeterminate = false; double progress = (e.Progress + (cleanedCount * 100.0)) / totalAppsCount; progress = Math.Min(Math.Max(progress, 0.0), 100.0); progressBar1.Value = progress; return; } messageTextBlock.Text = e.Message; message2TextBlock.Text = e.Message2; if (e.State == BackupState.ResettingAppData) { cleanedCount++; return; } if (e.Progress < 0) { progressBar1.IsIndeterminate = true; } else { if (progressBar1.IsIndeterminate) { progressBar1.IsIndeterminate = false; } progressBar1.Value = e.Progress; } if ((e.Log != null) && (e.Log.Count != LogsView.Items.Count)) { //Update the list for (int i = LogsView.Items.Count; i < e.Log.Count; i++) { log.Insert(0, e.Log[i]); } } lastUpdate = DateTime.Now; }