protected override void AfterShellCreated()
        {
            base.AfterShellCreated();

            ShellNotificationService notificationService = new ShellNotificationService(this.Shell);

            RootWorkItem.Services.Add(typeof(IMessageBoxService), notificationService);
        }
示例#2
0
        private static void HandleException(Exception ex)
        {
            if (ex == null)
            {
                return;
            }

            ShellNotificationService notifications = new ShellNotificationService();

            notifications.Show(BuildExceptionString(ex), "Error",
                               MessageBoxButtons.OK, MessageBoxIcon.Error);


            Environment.Exit(0);
        }
示例#3
0
        private static void HandleException(Exception ex)
        {
            if (ex == null)
            {
                return;
            }

            ShellNotificationService notifications = new ShellNotificationService();

            if (ExceptionPolicy.HandleException(ex, "Default Policy"))
            {
                notifications.Show(Properties.Resources.UnhandledExceptionMessage, Properties.Resources.UnhandledExceptionTitle,
                                   MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            Environment.Exit(0);
        }