Permalink
Browse files

Added NBug.

  • Loading branch information...
kaisellgren committed Jul 6, 2012
1 parent 3936b6b commit e8118b6b8470f7142af6482e5a58231c9edcce23
Showing with 14 additions and 22 deletions.
  1. +9 −21 App.xaml.cs
  2. +3 −0 Git-GUI.csproj
  3. +1 −1 UserControls/NewTabPage.xaml.cs
  4. +1 −0 packages.config
View
@@ -1,6 +1,5 @@
using System;
using System.Windows;
-using GG.UserControls.Dialogs;
namespace GG
{
@@ -9,6 +8,14 @@ namespace GG
/// </summary>
public partial class App : Application
{
+ public App()
+ {
+ #if !DEBUG
+ AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException;
+ Application.Current.DispatcherUnhandledException += NBug.Handler.DispatcherUnhandledException;
+ #endif
+ }
+
protected override void OnStartup(StartupEventArgs e)
{
var mainWindow = new MainWindow
@@ -18,26 +25,7 @@ protected override void OnStartup(StartupEventArgs e)
base.MainWindow = mainWindow;
- // Set up a global exception handler.
- AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
-
mainWindow.Show();
}
-
- private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
- {
- var dialog = new ConfirmDialog
- {
- Title = "Error occured",
- Message = unhandledExceptionEventArgs.ExceptionObject.ToString(),
- ButtonSet = ConfirmDialog.ButtonsSet.OK,
- MaxHeight = 640,
- MaxWidth = 800
- };
-
- dialog.ShowDialog();
-
- Environment.Exit(1);
- }
}
-}
+}
View
@@ -134,6 +134,9 @@
<Reference Include="Microsoft.Windows.Shell">
<HintPath>packages\Microsoft.Windows.Shell.3.0.1.0\lib\net40\Microsoft.Windows.Shell.dll</HintPath>
</Reference>
+ <Reference Include="NBug">
+ <HintPath>packages\NBug.1.1.1\lib\net40-client\NBug.dll</HintPath>
+ </Reference>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
<Reference Include="System.Data" />
@@ -90,7 +90,7 @@ private void OnCreateLocalRepository(object sender, RoutedEventArgs e)
dialog.ShowDialog();
// Open the selected folder if possible.
- if (dialog.SelectedPath != null && dialog.SelectedPath.Length > 0)
+ if (!string.IsNullOrEmpty(dialog.SelectedPath))
{
LibGit2Sharp.Repository.Init(dialog.SelectedPath).Dispose();
View
@@ -2,4 +2,5 @@
<packages>
<package id="LibGit2Sharp" version="0.9.5" />
<package id="Microsoft.Windows.Shell" version="3.0.1.0" />
+ <package id="NBug" version="1.1.1" targetFramework="net45" />
</packages>

0 comments on commit e8118b6

Please sign in to comment.