Beispiel #1
0
        public void App_Startup(object sender, StartupEventArgs e)
        {
            this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
            // Application is running
            //Check version
            AutoUpdate updater = new AutoUpdate();

            mb = new MainBrowser();
            updater.Show();

            _iconMenu = new ContextMenu();


            _icon = new NotifyIcon
            {
                Icon        = new Icon("chromasync.ico"),
                ContextMenu = _iconMenu,
                Visible     = true,
            };

            _icon.MouseClick += new MouseEventHandler(ShowBrowser);
            MenuItem about = new MenuItem("Visit website", showAbout);

            scriptsMenu  = new MenuItem("Scripts");
            packagesMenu = new MenuItem("Packages");
            var version = new MenuItem("version: " + CurrentVersion);

            version.Enabled = false;
            _iconMenu.MenuItems.Add(version);

            _iconMenu.MenuItems.Add("-");
            _iconMenu.MenuItems.Add(about);

            NewScriptsContext();
            NewPackagesContext();

            MenuItem exitMenuItem = new MenuItem("Exit", Quit);

            _iconMenu.MenuItems.Add(scriptsMenu);
            _iconMenu.MenuItems.Add(exitMenuItem);

            // Start services
            StartServices();

            // TODO: Browser

            mb.Show();
            FirstRun();
        }
Beispiel #2
0
        private void ShowBrowser(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (!mb.IsLoaded)
                {
                    mb = new MainBrowser();
                }

                mb.Show();
                if (mb.WindowState == WindowState.Minimized)
                {
                    mb.WindowState = WindowState.Normal;
                }
            }
        }