Beispiel #1
0
        public void Run(
            Settings setting,
            Servers servers,
            ShareLinkMgr shareLinkMgr,
            Updater updater)
        {
            this.setting  = setting;
            this.servers  = servers;
            this.slinkMgr = shareLinkMgr;
            this.updater  = updater;

            CreateNotifyIcon();

            BindServerEvents();

            ni.MouseClick += (s, a) =>
            {
                if (a.Button != MouseButtons.Left)
                {
                    return;
                }

                // https://stackoverflow.com/questions/2208690/invoke-notifyicons-context-menu
                // MethodInfo mi = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);
                // mi.Invoke(ni, null);

                Views.WinForms.FormMain.GetForm()?.Show();
            };

            notifierUpdater.DoItLater();
            serversMenuUpdater.DoItLater();
        }
Beispiel #2
0
 public void Run(
     Settings setting,
     Servers servers,
     ConfigMgr configMgr,
     ShareLinkMgr slinkMgr,
     Notifier notifier)
 {
     this.setting  = setting;
     this.notifier = notifier;
     vgcApis.Run(setting, servers, configMgr, slinkMgr, notifier);
 }
Beispiel #3
0
        public void Run(
            Settings setting,
            Servers servers,
            ConfigMgr configMgr,
            ShareLinkMgr slinkMgr,
            Notifier notifier)
        {
            this.setting  = setting;
            this.notifier = notifier;

            vgcApis.Run(setting, servers, configMgr, slinkMgr, notifier);
            plugins = LoadAllPlugins();
            RestartAllPlugins();
        }
Beispiel #4
0
        public void Run(
            Settings setting,
            Servers servers,
            ShareLinkMgr shareLinkMgr,
            Updater updater)
        {
            this.setting  = setting;
            this.servers  = servers;
            this.slinkMgr = shareLinkMgr;
            this.updater  = updater;

            CreateNotifyIcon();

            BindServerEvents();

            BindMouseClickEvent();

            UpdateNotifyIcon();
        }
Beispiel #5
0
        public void Run(
            Settings setting,
            Servers servers,
            ShareLinkMgr shareLinkMgr,
            Updater updater)
        {
            this.setting  = setting;
            this.servers  = servers;
            this.slinkMgr = shareLinkMgr;
            this.updater  = updater;

            lazyNotifierMenuUpdater = new VgcApis.Libs.Tasks.LazyGuy(
                UpdateNotifyIconWorker, UpdateInterval, 5000)
            {
                Name = "Notifier.MenuUpdater", // disable debug logging
            };

            BindNiMenuEvents(ni);
            BindServerEvents();
            RefreshNotifyIconLater();
        }