Exemple #1
0
        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);
        }
Exemple #2
0
        public bool Unregister(String name, NotificationDelegate del)
        {
            NotificationDelegateList list = FindList(name);

            if (list != null)
            {
                return(list.Remove(del));
            }

            return(false);
        }
Exemple #3
0
        public void PostImmediately(Notification notification)
        {
            String name = notification.name;
            NotificationDelegateList list = FindList(name);

            if (list != null)
            {
                list.NotifyDelegates(notification);
            }
            m_notificatoinsPool.RecycleObject(notification);
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
        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);
        }