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

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

                return(itemsDumped);
            }
        }
Пример #2
0
        public List <TReturnArgs> SendEvent(object sender, TEventArgs newEvent)
        {
            List <TReturnArgs> returnList = null;

            lock (s_lock)
            {
                if (null != ReturningEventRecieved)
                {
                    returnList = new List <TReturnArgs>(ReturningEventRecieved.GetInvocationList().Length);

                    foreach (Delegate returningEventRecieved in ReturningEventRecieved.GetInvocationList())
                    {
                        object returnObject = returningEventRecieved.DynamicInvoke(new object[] { sender, newEvent });
                        returnList.Add((TReturnArgs)returnObject);
                    }
                }

                return(returnList);
            }
        }