public void Remove(EventId <EventKeyType> eventId) { EventCallbackMgr <EventKeyType> cbMgr = null; if (m_eventCbMgrs.TryGetValue(eventId.key, out cbMgr)) { cbMgr.RemoveCallback(eventId.idx); } }
public void Fire(EventKeyType eventKey, object param) { EventCallbackMgr <EventKeyType> cbMgr = null; if (m_eventCbMgrs.TryGetValue(eventKey, out cbMgr)) { cbMgr.FireCallbacks(param); } }
protected EventId <EventKeyType> DoSubscribe(EventKeyType eventKey, EventCallback <EventKeyType> ecb) { EventCallbackMgr <EventKeyType> cbMgr = null; if (!m_eventCbMgrs.TryGetValue(eventKey, out cbMgr)) { cbMgr = new EventCallbackMgr <EventKeyType>(eventKey); m_eventCbMgrs.Add(eventKey, cbMgr); } ulong eid = cbMgr.AddCallback(ecb); EventId <EventKeyType> ret = new EventId <EventKeyType>(); ret.key = eventKey; ret.idx = eid; ret.mgr = new WeakReference(this); return(ret); }