示例#1
0
        public void DisplayException(Exception exception)
        {
            //Push the exception
            Logger.LogError("Exception", exception.ToString());
            Logger.LogError("Exception-StackTrace", exception.StackTrace);

            if (null != CurrentGraphCanvas.VisualHost)
            {
                // When a crash happens during file-load, the controller would have
                // been 'null' and no UI or VM states would have been recorded. Here
                // we determine if "VisualHost" is 'null' (in which case the file is
                // still being loaded), if so then we won't attempt to store the
                // recorded states.
                string uiStates = CurrentGraphCanvas.Controller.GetRecordedUiStates();
                string vmStates = CurrentGraphCanvas.Controller.GetRecordedVmStates();

                Logger.LogError("Exception-uiStates", uiStates);
                Logger.LogError("Exception-vmStates", vmStates);
            }

#if DEBUG
            ExceptionWindow window = new ExceptionWindow(exception);

            if (null != Application.Current)
            {
                window.Owner = Application.Current.MainWindow;
            }

            window.ShowDialog();
#else
            // Show the end-user facing dialog.
            PopupDialog relaunchDialog = new PopupDialog(ResourceNames.Error, UiStrings.Relaunch, string.Empty, string.Empty, "Relaunch");
            if (null != Application.Current)
            {
                relaunchDialog.Owner = Application.Current.MainWindow;
            }

            relaunchDialog.ShowDialog();
#endif
        }
示例#2
0
        public void DisplayException(Exception exception)
        {
            //Push the exception
            Logger.LogError("Exception", exception.ToString());
            Logger.LogError("Exception-StackTrace", exception.StackTrace);

            if (null != CurrentGraphCanvas.VisualHost)
            {
                // When a crash happens during file-load, the controller would have
                // been 'null' and no UI or VM states would have been recorded. Here
                // we determine if "VisualHost" is 'null' (in which case the file is
                // still being loaded), if so then we won't attempt to store the
                // recorded states.
                string uiStates = CurrentGraphCanvas.Controller.GetRecordedUiStates();
                string vmStates = CurrentGraphCanvas.Controller.GetRecordedVmStates();

                Logger.LogError("Exception-uiStates", uiStates);
                Logger.LogError("Exception-vmStates", vmStates);
            }

            #if DEBUG
            ExceptionWindow window = new ExceptionWindow(exception);

            if (null != Application.Current)
                window.Owner = Application.Current.MainWindow;

            window.ShowDialog();
            #else
            // Show the end-user facing dialog.
            PopupDialog relaunchDialog = new PopupDialog(ResourceNames.Error, UiStrings.Relaunch, string.Empty, string.Empty, "Relaunch");
            if (null != Application.Current)
                relaunchDialog.Owner = Application.Current.MainWindow;

            relaunchDialog.ShowDialog();
            #endif
        }