protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); //for install plugin command when wox didn't start up //we shouldn't init MainWindow, just intall plugin and exit. if (e.Args.Length > 0 && e.Args[0].ToLower() == "installplugin") { var path = e.Args[1]; if (!File.Exists(path)) { MessageBox.Show("Plugin " + path + " didn't exist"); return; } PluginInstaller.Install(path); Environment.Exit(0); return; } window = new MainWindow(); if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart") { window.ShowApp(); } window.ParseArgs(e.Args); }
protected override void OnStartup(StartupEventArgs e) { this.DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; base.OnStartup(e); //for install plugin command when wox didn't start up //we shouldn't init MainWindow, just intall plugin and exit. if (e.Args.Length > 0 && e.Args[0].ToLower() == "installplugin") { var path = e.Args[1]; if (!File.Exists(path)) { MessageBox.Show("Plugin " + path + " didn't exist"); return; } PluginInstaller.Install(path); Environment.Exit(0); return; } if (e.Args.Length > 0 && e.Args[0].ToLower() == "plugindebugger") { var path = e.Args[1]; PluginLoader.Plugins.ActivatePluginDebugger(path); } window = new MainWindow(); if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart") { window.ShowApp(); } window.ParseArgs(e.Args); }
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()); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); window = new MainWindow(); if (e.Args.Length == 0 || e.Args[0].ToLower() != "starthide") { window.ShowApp(); } window.ParseArgs(e.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); DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); }); Window = new MainWindow(); PluginManager.Init(Window); CommandArgsFactory.Execute(e.Args.ToList()); }); }
public SettingWidow(MainWindow mainWindow) { this.mainWindow = mainWindow; InitializeComponent(); Loaded += Setting_Loaded; cbReplaceWinR.Checked += (o, e) => { CommonStorage.Instance.UserSetting.ReplaceWinR = true; CommonStorage.Instance.Save(); }; cbReplaceWinR.Unchecked += (o, e) => { CommonStorage.Instance.UserSetting.ReplaceWinR = false; CommonStorage.Instance.Save(); }; }
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 SettingWindow(MainWindow mainWindow) { this.MainWindow = mainWindow; InitializeComponent(); Loaded += Setting_Loaded; }
private void OnStartup(object sender, StartupEventArgs e) { Stopwatch.Normal("Startup Time", () => { RegisterDispatcherUnhandledException(); var settingVM = new SettingWindowViewModel(); _settings = settingVM.Settings; PluginManager.LoadPlugins(_settings.PluginSettings); var mainVM = new MainViewModel(_settings); var window = new MainWindow(_settings, mainVM); API = new PublicAPIInstance(settingVM, mainVM); PluginManager.InitializePlugins(API); ImageLoader.PreloadImages(); Current.MainWindow = window; Current.MainWindow.Title = Infrastructure.Constant.Wox; RegisterExitEvents(); AutoStartup(); AutoUpdates(); if (!_settings.HideOnStartup) { mainVM.MainWindowVisibility = Visibility.Visible; } }); }