示例#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
文件: App.xaml.cs 项目: renzhn/Wox
        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());
        }
示例#4
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);
        }
示例#5
0
文件: App.xaml.cs 项目: kayone/Wox
 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());
     });
 }
示例#6
0
        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());
            });
        }
示例#7
0
 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();
     };
 }
示例#8
0
        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());
            });
        }
示例#9
0
 public SettingWindow(MainWindow mainWindow)
 {
     this.MainWindow = mainWindow;
     InitializeComponent();
     Loaded += Setting_Loaded;
 }
示例#10
0
文件: App.xaml.cs 项目: cxfksword/Wox
        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;
                }
            });
        }
示例#11
0
 public SettingWindow(MainWindow mainWindow)
 {
     this.MainWindow = mainWindow;
     InitializeComponent();
     Loaded += Setting_Loaded;
 }