Пример #1
0
        public void Run(
            Setting setting,
            Servers servers,
            ShareLinkMgr shareLinkMgr)
        {
            this.setting  = setting;
            this.servers  = servers;
            this.slinkMgr = shareLinkMgr;

            CreateNotifyIcon();

            servers.OnRequireNotifyTextUpdate +=
                OnRequireNotifyTextUpdateHandler;


            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();
        }
Пример #2
0
        public void Run(
            Setting setting,
            Servers servers,
            ConfigMgr configMgr,
            ShareLinkMgr slinkMgr,
            Notifier notifier)
        {
            this.setting  = setting;
            this.notifier = notifier;

            vgcApis.Run(setting, servers, configMgr, slinkMgr);
            plugins = LoadAllPlugins();
            RestartAllPlugins();
        }