コード例 #1
0
 public static void Create(Exception ex)
 {
     var window = new ErrorWindow(ex);
     if (Global.MainWindow != null)
     {
         window.Owner = Global.MainWindow;
         window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     }
     else
     {
         window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
     }
     window.ShowDialog();
     throw ex;
 }
コード例 #2
0
        public static void Create(Exception ex)
        {
            var window = new ErrorWindow(ex);

            if (Global.MainWindow != null)
            {
                window.Owner = Global.MainWindow;
                window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }
            else
            {
                window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            }
            window.ShowDialog();
            throw ex;
        }
コード例 #3
0
        private void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
        {
            Exception   exception = e.ExceptionObject as Exception;
            ErrorWindow error     = new ErrorWindow(exception);

            if (this.IsVisible)
            {
                error.Owner = this;
                error.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            }
            else
            {
                error.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            }
            error.ShowDialog();
            this.Close();
        }
コード例 #4
0
 private void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
 {
     Exception exception = e.ExceptionObject as Exception;
     ErrorWindow error = new ErrorWindow(exception);
     if (this.IsVisible)
     {
         error.Owner = this;
         error.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
     }
     else
     {
         error.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
     }
     error.ShowDialog();
     this.Close();
 }