예제 #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();
     }
 }