//初始化托盘图标 void InitTrayNotifyIcon() { notifyIconManager = new IPMessagerNet.UI.Comp.NotifyIconManager(notifyIcon); //左键点击显示,右键点击菜单 Action showForm = () => { if (hostView.IsInFloatMode) { hostContainer.WindowState = FormWindowState.Normal; hostContainer.Visible = true; } else { this.ShowInTaskbar = true; this.Show(); } }; notifyIcon.MouseClick += (s, e) => { if (e.Button == MouseButtons.Left) { showForm(); } }; notifyIconManager.AskQuit += (s, e) => { ShutdownIPM(); }; notifyIconManager.MuteModeChanged += (s, e) => { IsMute = notifyIconManager.IsMute; }; notifyIconManager.ShowInfomation += (s, e) => { ShowAbout(); }; notifyIconManager.ShowMainForm += (s, e) => { showForm(); }; notifyIconManager.StateChanged += (s, e) => { if (e.IsInAbsenceMode) { hostView.SwitchToAbsence(e.AbsenceMessage); } else { hostView.SwitchToOnLine(); } }; }
//初始化托盘图标 void InitTrayNotifyIcon() { notifyIconManager = new IPMessagerNet.UI.Comp.NotifyIconManager(notifyIcon); //左键点击显示,右键点击菜单 Action showForm = () => { if (hostView.IsInFloatMode) { hostContainer.WindowState = FormWindowState.Normal; hostContainer.Visible = true; } else { this.ShowInTaskbar = true; this.Show(); } }; notifyIcon.MouseClick += (s, e) => { if (e.Button == MouseButtons.Left) showForm(); }; notifyIconManager.AskQuit += (s, e) => { ShutdownIPM(); }; notifyIconManager.MuteModeChanged += (s, e) => { IsMute = notifyIconManager.IsMute; }; notifyIconManager.ShowInfomation += (s, e) => { ShowAbout(); }; notifyIconManager.ShowMainForm += (s, e) => { showForm(); }; notifyIconManager.StateChanged += (s, e) => { if (e.IsInAbsenceMode) { hostView.SwitchToAbsence(e.AbsenceMessage); } else { hostView.SwitchToOnLine(); } }; }