Esempio n. 1
0
        } // App()

        /// <summary>
        /// Called when an application exception is thrown.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The
        ///  <see cref="System.Windows.Threading.DispatcherUnhandledExceptionEventArgs"/> 
        /// instance containing the event data.</param>
        private static void OnApplicationException(object sender,
          DispatcherUnhandledExceptionEventArgs e)
        {
            var win = new AppErrorWindow(e.Exception);
            win.Owner = Current.MainWindow;
            win.ShowDialog();
            e.Handled = true;
        } // OnApplicationException()
Esempio n. 2
0
        } // OnApplicationException()

        /// <summary>
        /// Called when an AppDomain exception is thrown.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.UnhandledExceptionEventArgs"/>
        /// instance containing the event data.</param>
        private static void OnAppDomainException(object sender,
          UnhandledExceptionEventArgs e)
        {
            var ex = e.ExceptionObject as Exception;
            if (ex != null)
            {
                AppErrorWindow win = new AppErrorWindow(ex);
                win.Owner = Current.MainWindow;
                win.ShowDialog();
            } // if
        } // OnAppDomainException()