You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Configuration; |
|
using System.Data; |
|
using System.Linq; |
|
using System.Windows; |
|
using SharpDevelop.Samples.XamlDesigner.Properties; |
|
using System.Windows.Threading; |
|
using System.Diagnostics; |
|
|
|
namespace SharpDevelop.Samples.XamlDesigner |
|
{ |
|
public partial class App : Application |
|
{ |
|
public static string[] Args; |
|
|
|
protected override void OnStartup(StartupEventArgs e) |
|
{ |
|
Args = e.Args; |
|
DispatcherUnhandledException += App_DispatcherUnhandledException; |
|
System.Windows.Forms.Application.EnableVisualStyles(); |
|
base.OnStartup(e); |
|
} |
|
|
|
void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) |
|
{ |
|
if (!Debugger.IsAttached && Shell.Instance.CurrentDocument != null) { |
|
Shell.Instance.CurrentDocument.Context.DesignView.Exception = e.Exception; |
|
e.Handled = true; |
|
} |
|
} |
|
|
|
protected override void OnExit(ExitEventArgs e) |
|
{ |
|
Settings.Default.Save(); |
|
base.OnExit(e); |
|
} |
|
} |
|
}
|
|
|