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