예제 #1
0
        /// <summary>
        /// Ensure information is consistent with the currently selected disc type
        /// </summary>
        private void EnsureDiscInformation()
        {
            // Get the current environment information
            _env = DetermineEnvironment();

            // Take care of null cases
            if (_env.System == null)
            {
                _env.System = KnownSystem.NONE;
            }
            if (_env.Type == null)
            {
                _env.Type = MediaType.NONE;
            }

            // Get the status to write out
            Result result = Validators.GetSupportStatus(_env.System, _env.Type);

            StatusLabel.Content = result.Message;

            // Set the index for the current disc type
            SetCurrentDiscType();

            StartStopButton.IsEnabled = result && (_drives != null && _drives.Count > 0 ? true : false);

            // If we're in a type that doesn't support drive speeds
            DriveSpeedComboBox.IsEnabled = _env.Type.DoesSupportDriveSpeed() && _env.System.DoesSupportDriveSpeed();

            // Special case for Custom input
            if (_env.System == KnownSystem.Custom)
            {
                ParametersTextBox.IsEnabled           = true;
                OutputFilenameTextBox.IsEnabled       = false;
                OutputDirectoryTextBox.IsEnabled      = false;
                OutputDirectoryBrowseButton.IsEnabled = false;
                DriveLetterComboBox.IsEnabled         = false;
                DriveSpeedComboBox.IsEnabled          = false;
                StartStopButton.IsEnabled             = (_drives.Count > 0 ? true : false);
                StatusLabel.Content = "User input mode";
            }
            else
            {
                ParametersTextBox.IsEnabled           = false;
                OutputFilenameTextBox.IsEnabled       = true;
                OutputDirectoryTextBox.IsEnabled      = true;
                OutputDirectoryBrowseButton.IsEnabled = true;
                DriveLetterComboBox.IsEnabled         = true;

                // Generate the full parameters from the environment
                string generated = _env.GetFullParameters((int?)DriveSpeedComboBox.SelectedItem);
                if (generated != null)
                {
                    ParametersTextBox.Text = generated;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Ensure information is consistent with the currently selected disc type
        /// </summary>
        private void EnsureDiscInformation()
        {
            // Get the current environment information
            _env = DetermineEnvironment();

            // Take care of null cases
            if (_env.System == null)
            {
                _env.System = KnownSystem.NONE;
            }
            if (_env.Type == null)
            {
                _env.Type = MediaType.NONE;
            }

            // Get the status to write out
            Result result = Validators.GetSupportStatus(_env.System, _env.Type);

            StatusLabel.Text = result.Message;

            // Set the index for the current disc type
            SetCurrentDiscType();

            StartStopButton.Enabled = result && (_drives != null && _drives.Count > 0 ? true : false);

            // If we're in a type that doesn't support drive speeds
            DriveSpeedComboBox.Enabled = _env.Type.DoesSupportDriveSpeed();

            // If input params are not enabled, generate the full parameters from the environment
            if (!ParametersTextBox.Enabled)
            {
                string generated = _env.GetFullParameters((int?)DriveSpeedComboBox.SelectedItem);
                if (generated != null)
                {
                    ParametersTextBox.Text = generated;
                }
            }
        }