public bool UnregisterAll(Object target) { bool removed = false; foreach (KeyValuePair <String, NotificationDelegateList> e in m_registerMap) { NotificationDelegateList list = e.Value; removed |= list.RemoveAll(target); } return(removed); }
public bool Unregister(String name, NotificationDelegate del) { NotificationDelegateList list = FindList(name); if (list != null) { return(list.Remove(del)); } return(false); }
public void PostImmediately(Notification notification) { String name = notification.name; NotificationDelegateList list = FindList(name); if (list != null) { list.NotifyDelegates(notification); } m_notificatoinsPool.RecycleObject(notification); }
public void Post(Object sender, String name, Object data = null, Object data2 = null, Object data3 = null, Object data4 = null) { NotificationDelegateList list = FindList(name); if (list != null && list.Count() > 0) { Notification notification = m_notificatoinsPool.NextObject(); notification.Init(sender, name, data, data2, data3, data4); SchedulePost(notification); } }
public void PostImmediately(Object sender, String name, Object data = null, Object data2 = null, Object data3 = null, Object data4 = null) { NotificationDelegateList list = FindList(name); if (list != null && list.Count() > 0) { Notification notification = m_notificatoinsPool.NextObject(); notification.Init(sender, name, data, data2, data3, data4); list.NotifyDelegates(notification); m_notificatoinsPool.RecycleObject(notification); } }
public void Register(String name, NotificationDelegate del) { Debug.Assert(name != null); Debug.Assert(del != null); NotificationDelegateList list = FindList(name); if (list == null) { list = new NotificationDelegateList(); m_registerMap[name] = list; } list.Add(del); }