public App() { DependencyEmbedder dependencyEmbedder = new DependencyEmbedder(); dependencyEmbedder.AddPackage("Newtonsoft.Json"); dependencyEmbedder.AddPackage("SharpDX.DirectInput"); dependencyEmbedder.AddPackage("SharpDX"); dependencyEmbedder.AddPackage("Hardcodet.Wpf.TaskbarNotification"); dependencyEmbedder.AddPackage("Nefarius.ViGEm.Client"); dependencyEmbedder.Initialize(); string exePath = Assembly.GetExecutingAssembly().Location; string cwd = Path.GetDirectoryName(exePath); Directory.SetCurrentDirectory(cwd); ApplicationContext globalContext = ApplicationContext.Global; globalContext.Resolvers.Add(Resolver.CreateSingleton(Dispatcher)); globalContext.AddFromConfiguration(typeof(ApplicationConfiguration)); globalContext.AddFromConfiguration(typeof(UI.UIConfiguration)); singleInstanceProvider = new SingleInstanceProvider(); argumentParser = globalContext.Resolve <ArgumentParser>(); #if !DEBUG Dispatcher.UnhandledException += async(object sender, DispatcherUnhandledExceptionEventArgs e) => await UnhandledException(e.Exception); #endif }
public App() { Dispatcher.UnhandledException += (object sender, DispatcherUnhandledExceptionEventArgs e) => UnhandledException(e.Exception, LogLevel.Error); AppDomain.CurrentDomain.FirstChanceException += (object sender, FirstChanceExceptionEventArgs e) => UnhandledException(e.Exception, LogLevel.Info); AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) => UnhandledException(e.ExceptionObject as Exception, LogLevel.Error); TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs e) => UnhandledException(e.Exception, LogLevel.Error); DependencyEmbedder dependencyEmbedder = new DependencyEmbedder(); dependencyEmbedder.AddPackage("Newtonsoft.Json"); dependencyEmbedder.AddPackage("SharpDX.DirectInput"); dependencyEmbedder.AddPackage("SharpDX"); dependencyEmbedder.AddPackage("Hardcodet.Wpf.TaskbarNotification"); dependencyEmbedder.AddPackage("Nefarius.ViGEm.Client"); dependencyEmbedder.Initialize(); string exePath = Assembly.GetExecutingAssembly().Location; string cwd = Path.GetDirectoryName(exePath); Directory.SetCurrentDirectory(cwd); }