private static string CheckCrash()
        {
            string res = null;

            if (CrashHandler.LastSessionCrashed)
            {
                TaskDialog dialog = new TaskDialog();
                dialog.WindowTitle     = "Warning";
                dialog.MainIcon        = TaskDialogIcon.Warning;
                dialog.MainInstruction = "It seems like a file can be recovered from last session.";
                dialog.Content         = "Would you like to attempt to recover the file?";
                TaskDialogButton saveButton = new TaskDialogButton(ButtonType.Yes);
                saveButton.Text = "Yes";
                dialog.Buttons.Add(saveButton);
                TaskDialogButton noSaveButton = new TaskDialogButton(ButtonType.No);
                noSaveButton.Text = "No";
                dialog.Buttons.Add(noSaveButton);
                TaskDialogButton button = dialog.ShowDialog();
                string           temp   = CrashHandler.RecoverLastSessionFile();
                if (button.ButtonType == ButtonType.Yes)
                {
                    res = temp;
                }
            }
            return(res);
        }
Beispiel #2
0
        public static string CheckCrash()
        {
            string res = null;

            if (CrashHandler.LastSessionCrashed)
            {
                DialogResult dr = MessageBox.Show(@"It seems like a file can be recovered from last session.
Would you like to attempt to recover the file?",
                                                  "Warning: Recover Lost Work",
                                                  MessageBoxButtons.YesNo,
                                                  MessageBoxType.Warning,
                                                  MessageBoxDefaultButton.Yes);

                string temp = CrashHandler.RecoverLastSessionFile();
                if (dr == DialogResult.Yes)
                {
                    res = temp;
                }
            }
            return(res);
        }