protected override void OnStartup(StartupEventArgs e) { Stopwatch.Debug("Startup Time", () => { base.OnStartup(e); WoxDirectroy.Executable = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString(); RegisterUnhandledException(); ThreadPool.SetMaxThreads(30, 10); ThreadPool.SetMinThreads(10, 5); ThreadPool.QueueUserWorkItem(_ => { ImageLoader.ImageLoader.PreloadImages(); }); PluginManager.Initialize(); UserSettingStorage settings = UserSettingStorage.Instance; // happlebao temp fix for instance code logic HttpProxy.Instance.Settings = settings; InternationalizationManager.Instance.Settings = settings; ThemeManager.Instance.Settings = settings; MainViewModel mainVM = new MainViewModel(settings); API = new PublicAPIInstance(mainVM, settings); PluginManager.InitializePlugins(API); Window = new MainWindow(settings, mainVM); NotifyIconManager notifyIconManager = new NotifyIconManager(API); CommandArgsFactory.Execute(e.Args.ToList()); }); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; Window = new MainWindow(); CommandArgsFactory.Execute(e.Args.ToList()); }
public void OnActivate(IList <string> args) { if (args.Count > 0 && args[0] == SingleInstance <App> .Restart) { API.CloseApp(); } else { CommandArgsFactory.Execute(args); } }
protected override void OnStartup(StartupEventArgs e) { Stopwatch.Debug("Startup Time", () => { base.OnStartup(e); RegisterUnhandledException(); ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); }); Window = new MainWindow(); PluginManager.Init(Window); CommandArgsFactory.Execute(e.Args.ToList()); }); }
protected override void OnStartup(StartupEventArgs e) { Stopwatch.Debug("Startup Time", () => { base.OnStartup(e); RegisterUnhandledException(); Task.Factory.StartNew(ImageLoader.PreloadImages); MainViewModel mainVM = new MainViewModel(); API = new PublicAPIInstance(mainVM, mainVM._settings); PluginManager.InitializePlugins(API); mainVM._settings.UpdatePluginSettings(); Window = new MainWindow(mainVM._settings, mainVM); NotifyIconManager notifyIconManager = new NotifyIconManager(API); CommandArgsFactory.Execute(e.Args.ToList()); }); }
protected override void OnStartup(StartupEventArgs e) { Stopwatch.Debug("Startup Time", () => { base.OnStartup(e); WoxDirectroy.Executable = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString(); RegisterUnhandledException(); ThreadPool.SetMaxThreads(30, 10); ThreadPool.SetMinThreads(10, 5); ThreadPool.QueueUserWorkItem(_ => { ImageLoader.ImageLoader.PreloadImages(); }); MainViewModel mainVM = new MainViewModel(); API = new PublicAPIInstance(mainVM); Window = new MainWindow { DataContext = mainVM }; NotifyIconManager notifyIconManager = new NotifyIconManager(API); PluginManager.Init(API); CommandArgsFactory.Execute(e.Args.ToList()); }); }
public bool OnActivate(IList <string> args) { CommandArgsFactory.Execute(args); return(true); }