Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();
            Instance   = this;
            serializer = CreateAndConfigureSerializer();

            tabControl.Visibility   = Visibility.Hidden;
            noSaveLoaded.Visibility = Visibility.Visible;

            Width       = MMSaveEditor.Properties.Settings.Default.Width;
            Height      = MMSaveEditor.Properties.Settings.Default.Height;
            WindowState = MMSaveEditor.Properties.Settings.Default.IsMaximized ? WindowState.Maximized : WindowState.Normal;

            MMSaveEditor.Properties.Settings.Default.RunCount++;
            MMSaveEditor.Properties.Settings.Default.Save();

            DonateBanner.Visibility = (MMSaveEditor.Properties.Settings.Default.RunCount >= 5 && !MMSaveEditor.Properties.Settings.Default.HasDonated) ? Visibility.Visible : Visibility.Collapsed;

            if (ReportGameCrashDialog.HasThereBeenAGameCrash())
            {
                MessageBoxResult result = MessageBox.Show("We have detected that Motorsport Manager crashed on the last run. Could you submit this log to us if it was a result of a change you made to your save file? We will then investigate the cause and fix in an update. Thanks!", "Did you just haz a crash", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
                if (result == MessageBoxResult.Yes)
                {
                    report_Click(null, null);
                }
                return;
            }
        }
Beispiel #2
0
        private void report_Click(object sender, RoutedEventArgs e)
        {
            ReportGameCrashDialog dialog = new ReportGameCrashDialog();

            dialog.ShowDialog();
            if (dialog.LogPath != null)
            {
                gameCrashLog = dialog.LogPath;
                NBug.Settings.ProcessingException += Settings_ProcessingException;
                try
                {
                    throw new Exception("Game is crashing report");
                }
                catch (Exception ex)
                {
                    new BugReport().Report(ex, ExceptionThread.Main);
                }
            }
        }