Example #1
0
        public static GenericMessage PeekAndTake(Type t)
        {
            lock (Message_queue_lock)
            {
                if (MessageQueue.Count <= 0)
                {
                    return(null);
                }

                GenericMessage gm = MessageQueue.Peek();
                if (gm.GetType() == t)
                {
                    return(Update());
                }
                else
                {
                    return(null);
                }
            }
        }