Пример #1
0
        public int Empty()
        {
            int itemsDumped = 0;

            lock (s_lock)
            {
                if (null != EventRecieved)
                {
                    itemsDumped   = EventRecieved.GetInvocationList().Length;
                    EventRecieved = null;
                }

                return(itemsDumped);
            }
        }
Пример #2
0
        public int SendEvent(object sender, T newEvent)
        {
            lock (s_lock)
            {
                if (null != EventRecieved)
                {
                    EventRecieved(sender, new BusEventArgs <T>(newEvent));

                    return(EventRecieved.GetInvocationList().Length);
                }
                else
                {
                    return(0);
                }
            }
        }