BlueSky.App.Application_DispatcherUnhandledException C# (CSharp) Метод

Application_DispatcherUnhandledException() приватный Метод

private Application_DispatcherUnhandledException ( object sender, System e ) : void
sender object
e System
Результат void
        private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            ILoggerService logService = LifetimeService.Instance.Container.Resolve<ILoggerService>();
            logService.WriteToLogLevel("XAML Application Dispatcher Unhandled Exception Occured :", LogLevelEnum.Fatal, e.Exception);
            MessageBox.Show("XAML Application Dispatcher:" + e.Exception.ToString());
            e.Handled = true;/// if you false this and comment following line, then, exception goes to Unhandeled
            GracefulExit();
            Environment.Exit(0);//We can remove this and can try to recover APP and keep it running.
        }