private void StartStopButtonClick(object sender, RoutedEventArgs e) { // Dump or stop the dump if ((string)StartStopButton.Content == Constants.StartDumping) { StartDumping(); } else if ((string)StartStopButton.Content == Constants.StopDumping) { ViewModels.LoggerViewModel.VerboseLogLn("Canceling dumping process..."); _env.CancelDumping(); CopyProtectScanButton.IsEnabled = true; if (EjectWhenDoneCheckBox.IsChecked == true) { ViewModels.LoggerViewModel.VerboseLogLn($"Ejecting disc in drive {_env.Drive.Letter}"); _env.EjectDisc(); } if (_options.ResetDriveAfterDump) { ViewModels.LoggerViewModel.VerboseLogLn($"Resetting drive {_env.Drive.Letter}"); _env.ResetDrive(); } } }
private void StartStopButtonClick(object sender, EventArgs e) { // Dump or stop the dump if (StartStopButton.Text == Constants.StartDumping) { StartDumping(); } else if (StartStopButton.Text == Constants.StopDumping) { ViewModels.LoggerViewModel.VerboseLogLn("Canceling dumping process..."); _env.CancelDumping(); CopyProtectScanButton.Enabled = true; if (EjectWhenDoneCheckBox.Checked == true) { ViewModels.LoggerViewModel.VerboseLogLn($"Ejecting disc in drive {_env.Drive.Letter}"); _env.EjectDisc(); } } }
private void StartStopButtonClick(object sender, RoutedEventArgs e) { // Dump or stop the dump if ((string)StartStopButton.Content == UIElements.StartDumping) { StartDumping(); } else if ((string)StartStopButton.Content == UIElements.StopDumping) { _env.CancelDumping(); CopyProtectScanButton.IsEnabled = true; if (EjectWhenDoneCheckBox.IsChecked == true) { _env.EjectDisc(); } } }
/// <summary> /// Begin the dumping process using the given inputs /// </summary> private async void StartDumping() { _env = DetermineEnvironment(); try { // Check for the firmware first // TODO: Remove this (and method) once DIC end-to-end logging becomes a thing if (!await _env.DriveHasLatestFimrware()) { return; } StartStopButton.Content = UIElements.StopDumping; CopyProtectScanButton.IsEnabled = false; StatusLabel.Content = "Beginning dumping process"; ViewModels.LoggerViewModel.VerboseLogLn("Starting dumping process.."); var progress = new Progress <Result>(); progress.ProgressChanged += ProgressUpdated; Result result = await _env.StartDumping(progress); StatusLabel.Content = result ? "Dumping complete!" : result.Message; ViewModels.LoggerViewModel.VerboseLogLn(result ? "Dumping complete!" : result.Message); } catch { // No-op, we don't care what it was } finally { StartStopButton.Content = UIElements.StartDumping; CopyProtectScanButton.IsEnabled = true; } if (EjectWhenDoneCheckBox.IsChecked == true) { _env.EjectDisc(); } }