Ejemplo n.º 1
0
		static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
		{
			try {
				using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
					if (ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.InvokeRequired)
						box.ShowDialog();
					else
						box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
				}
			} catch (Exception ex) {
				LoggingService.Warn("Error showing ExceptionBox", ex);
				MessageBox.Show(exception.ToString(), message, MessageBoxButtons.OK,
				                MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
			}
		}
Ejemplo n.º 2
0
 static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
 {
     try {
         using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
             try {
                 box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
             } catch (InvalidOperationException) {
                 box.ShowDialog();
             }
         }
     } catch (Exception ex) {
         LoggingService.Warn("Error showing ExceptionBox", ex);
         MessageBox.Show(exception.ToString(), message, MessageBoxButtons.OK,
                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
     }
 }
Ejemplo n.º 3
0
        static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
        {
            if (exception == null)
            {
                throw new ArgumentNullException("exception");
            }

            // ignore reentrant calls (e.g. when there's an exception in OnRender)
            if (showingBox)
            {
                return;
            }
            showingBox = true;
            try {
                try {
                    AnalyticsMonitorService.TrackException(exception);
                } catch (Exception ex) {
                    LoggingService.Warn("Error tracking exception", ex);
                }
                using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
                    if (ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.InvokeRequired)
                    {
                        box.ShowDialog();
                    }
                    else
                    {
                        box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
                    }
                }
            } catch (Exception ex) {
                LoggingService.Warn("Error showing ExceptionBox", ex);
                MessageBox.Show(exception.ToString(), message, MessageBoxButtons.OK,
                                MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
            } finally {
                showingBox = false;
            }
        }
Ejemplo n.º 4
0
		public ContextMenuStrip GetContextMenu()
		{
			ContextMenuStrip menu = new ContextMenuStrip();
			
			ToolStripMenuItem showError;
			showError = new ToolStripMenuItem();
			showError.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.LocalVariables.ShowFullError}");
			showError.Checked = false;
			showError.Click += delegate {
				using (ExceptionBox box = new ExceptionBox(error, null, false)) {
					box.ShowDialog(WorkbenchSingleton.MainForm);
				}
			};
			
			menu.Items.AddRange(new ToolStripItem[] {
			                    	showError
			                    });
			
			return menu;
		}
Ejemplo n.º 5
0
		static void ShowErrorBox(Exception exception, string message, bool mustTerminate)
		{
			if (exception == null)
				throw new ArgumentNullException("exception");
			
			// ignore reentrant calls (e.g. when there's an exception in OnRender)
			if (showingBox)
				return;
			showingBox = true;
			try {
				try {
					AnalyticsMonitorService.TrackException(exception);
				} catch (Exception ex) {
					LoggingService.Warn("Error tracking exception", ex);
				}
				using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
					if (ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.InvokeRequired)
						box.ShowDialog();
					else
						box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
				}
			} catch (Exception ex) {
				LoggingService.Warn("Error showing ExceptionBox", ex);
				MessageBox.Show(exception.ToString(), message, MessageBoxButtons.OK,
				                MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
			} finally {
				showingBox = false;
			}
		}