public DatabaseErrorDialog(BackupDatabaseReadException ex)
        {
            InitializeComponent();

            Loaded += delegate
            {
                if ((ex is MissingBackupPathException) || (ex is MissingBackupFileException) || (ex is NoBackupsFoundException))
                {
                    errorDetailTextBox.Text = string.Format(MissingDatabaseError, ex.Message);
                    troubleshootingLink.Visibility = Visibility.Visible;
                }
                else if (ex is UnreadableDatabaseFileException)
                {
                    UnreadableDatabaseFileException unreadableDatabaseException = (UnreadableDatabaseFileException)ex;
                    errorDetailTextBox.Text = string.Format(UnreadableDatabaseFileError, unreadableDatabaseException.Filename);
                }
                else
                {
                    throw new ArgumentException("Unrecognized database error type.");
                }
            };
        }
示例#2
0
 private void ShowDatabaseErrorDialog(BackupDatabaseReadException ex)
 {
     DatabaseErrorDialog errorDialog = new DatabaseErrorDialog(ex);
     errorDialog.Owner = this;
     errorDialog.ShowDialog();
     if (errorDialog.DialogResult == true)
     {
         ShowSendFeedbackDialog();
     }
 }