private void NoticeDoEvent() { Notice notice = null; notice = NoticeQueue.DeQueue(); if (notice != null) { //if (new CfgLoader().GetConfig("show_notice") == "0") // return; IntPtr activeForm = GetActiveWindow(); int count = -1; while (true) { count = GetLocation(); if (count == -1) { sema_private.WaitOne(); } else { break; } } System.Windows.Forms.Form form = new NoticeWin(notice, count, SetLocation); form.Show(); SetActiveWindow(activeForm); while (!form.IsDisposed) { System.Windows.Forms.Application.DoEvents(); } } }
public void Start() { while (true) { if (NoticeQueue.Length() <= 0) { sema.WaitOne(); } else { ThreadHelper.ThreadStart(NoticeDoEvent); } } }
public static void Show(Notice notice, bool urgency) { NoticeQueue.EnQueue(notice, urgency); }
public static void Show(Notice notice) { NoticeQueue.EnQueue(notice); }