Пример #1
0
 public void Enqueue(InvokeEventClass item)
 {
     lock (_lock)
     {
         myQueue.Enqueue(item);
     }
 }
Пример #2
0
        public ImFriendBlackListNotify(object Parser)
        {
            uint parser = (uint)Parser;

            userInfoList = new List <xUserInfo>();
            userInfoList = InsertUserInfo(parser);
            InvokeEventClass myFriendList = new InvokeEventClass(ProtocolEnum.IM_FRIEND_BLACKLIST_NOTIFY, this);

            YunVaImInterface.eventQueue.Enqueue(myFriendList);
        }
Пример #3
0
 void Update()
 {
     if (eventQueue.GetData(tmpQ))
     {
         while (tmpQ.Count > 0)
         {
             InvokeEventClass obj = tmpQ.Dequeue();
             EventListenerManager.Invoke(obj.eventType, obj.dataObj);
         }
     }
 }
Пример #4
0
            public bool GetData(Queue <InvokeEventClass> outQ)
            {
                lock (_lock)
                {
                    int count = myQueue.Count;
                    if (count == 0)
                    {
                        return(false);
                    }

                    for (int i = 0; i < count; i++)
                    {
                        InvokeEventClass obj = myQueue.Dequeue();
                        outQ.Enqueue(obj);
                    }

                    return(true);
                }
            }