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