Exemple #1
0
        /// <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();
            }
        }
Exemple #2
0
        /// <summary>
        /// Begin the dumping process using the given inputs
        /// </summary>
        private async void StartDumping()
        {
            if (_env == null)
            {
                _env = DetermineEnvironment();
            }

            // If still in custom parameter mode, check that users meant to continue or not
            if (EnableParametersCheckBox.IsChecked == true)
            {
                MessageBoxResult result = MessageBox.Show("It looks like you have custom parameters that have not been saved. Would you like to apply those changes before starting to dump?", "Custom Changes", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    EnableParametersCheckBox.IsChecked = false;
                    ParametersTextBox.IsEnabled        = false;
                    ProcessCustomParameters();
                }
                else if (result == MessageBoxResult.Cancel)
                {
                    return;
                }
                // If "No", then we continue with the current known environment
            }

            try
            {
                // Check for the firmware first
                // TODO: Remove this (and method) once DIC end-to-end logging becomes a thing
                if (!await _env.DriveHasLatestFimrware())
                {
                    MessageBox.Show($"DiscImageCreator has reported that drive {_env.Drive.Letter} is not updated to the most recent firmware. Please update the firmware for your drive and try again.", "Outdated Firmware", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                // Validate that the user explicitly wants an inactive drive to be considered for dumping
                if (!_env.Drive.MarkedActive)
                {
                    MessageBoxResult mbresult = MessageBox.Show("The currently selected drive does not appear to contain a disc! Are you sure you want to continue?", "Missing Disc", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
                    if (mbresult == MessageBoxResult.No || mbresult == MessageBoxResult.Cancel || mbresult == MessageBoxResult.None)
                    {
                        ViewModels.LoggerViewModel.VerboseLogLn("Dumping aborted!");
                        return;
                    }
                }

                // If a complete dump already exists
                if (_env.FoundAllFiles())
                {
                    MessageBoxResult mbresult = MessageBox.Show("A complete dump already exists! Are you sure you want to overwrite?", "Overwrite?", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
                    if (mbresult == MessageBoxResult.No || mbresult == MessageBoxResult.Cancel || mbresult == MessageBoxResult.None)
                    {
                        ViewModels.LoggerViewModel.VerboseLogLn("Dumping aborted!");
                        return;
                    }
                }

                StartStopButton.Content         = Constants.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         = Constants.StartDumping;
                CopyProtectScanButton.IsEnabled = true;
            }

            if (EjectWhenDoneCheckBox.IsChecked == true)
            {
                ViewModels.LoggerViewModel.VerboseLogLn($"Ejecting disc in drive {_env.Drive.Letter}");
                _env.EjectDisc();
            }
        }