示例#1
1
文件: App.xaml.cs 项目: Rovak/Wox
        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);
        }
示例#2
0
文件: App.xaml.cs 项目: JackHang/Wox
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 public void Activate(string[] args)
 {
     if (args.Length == 0 || args[0].ToLower() != "hidestart")
     {
         window.ShowApp();
     }
     window.ParseArgs(args);
 }
示例#5
0
文件: App.xaml.cs 项目: pluto92/Wox
        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);
        }
示例#6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            window = new MainWindow();
            if (e.Args.Length == 0 || e.Args[0].ToLower() != "hidestart")
            {
                window.ShowApp();
            }

            window.ParseArgs(e.Args);
        }
示例#7
0
 void ctlHotkey_OnHotkeyChanged(object sender, System.EventArgs e)
 {
     if (ctlHotkey.CurrentHotkeyAvailable)
     {
         MainWindow.SetHotkey(ctlHotkey.CurrentHotkey, delegate
         {
             if (!MainWindow.IsVisible)
             {
                 MainWindow.ShowApp();
             }
             else
             {
                 MainWindow.HideApp();
             }
         });
         MainWindow.RemoveHotkey(UserSettingStorage.Instance.Hotkey);
         UserSettingStorage.Instance.Hotkey = ctlHotkey.CurrentHotkey.ToString();
         UserSettingStorage.Instance.Save();
     }
 }