public static void ShowNotice(int time, string title, string info, ToolTipIcon icon = ToolTipIcon.Info, Action CallBack = null, bool showNoticeInSystem = true) { if (OnDND) { return; } if (Environment.OSVersion.Version.Major >= 10) { if (showNoticeInSystem) { frmMain.InfoShow.ShowBalloonTip(time, title, info, icon); nowCallBack = CallBack; } } try { Program.frmMain.Invoke((EventHandler) delegate { //务必给主线程去调用 var f = new InfoShower() { Title = title, Info = info, ExistTime = time, ToolTip = icon }; f.CallBack = CallBack; InfoShower.ShowOnce(f); }); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public static void ShowOnce(InfoShower newInfo) { newInfo.FormClosed += (x, xx) => { list.Remove(newInfo); ReQueueInfo(); }; list.Add(newInfo); ReQueueInfo(); newInfo.ShowDirect(); }