Пример #1
0
        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();
                }
            }
        }
Пример #2
0
 public void Start()
 {
     while (true)
     {
         if (NoticeQueue.Length() <= 0)
         {
             sema.WaitOne();
         }
         else
         {
             ThreadHelper.ThreadStart(NoticeDoEvent);
         }
     }
 }
Пример #3
0
 public static void Show(Notice notice, bool urgency)
 {
     NoticeQueue.EnQueue(notice, urgency);
 }
Пример #4
0
 public static void Show(Notice notice)
 {
     NoticeQueue.EnQueue(notice);
 }