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) { 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()); }); }
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()); }); }