public int Empty() { int itemsDumped = 0; lock (s_lock) { if (null != ReturningEventRecieved) { itemsDumped = ReturningEventRecieved.GetInvocationList().Length; ReturningEventRecieved = null; } return(itemsDumped); } }
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); } }