示例#1
0
        public void PostImmediately(Notification notification)
        {
            string name = notification.Name;
            NotificationDelegateList list = FindList(name);

            if (list != null)
            {
                list.NotifyDelegates(notification);
            }
            notification.Recycle();
        }
示例#2
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);
        }
示例#3
0
        public bool Unregister(string name, NotificationDelegate del)
        {
            NotificationDelegateList list = FindList(name);

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

            return(false);
        }
示例#4
0
        public void Post(Object sender, string name, params object[] data)
        {
            NotificationDelegateList list = FindList(name);

            if (list != null && list.Count > 0)
            {
                Notification notification = m_notificatoinsPool.NextObject();
                notification.Init(sender, name, data);

                SchedulePost(notification);
            }
        }
示例#5
0
        public void PostImmediately(Object sender, string name, params object[] data)
        {
            NotificationDelegateList list = FindList(name);

            if (list != null && list.Count > 0)
            {
                Notification notification = m_notificatoinsPool.NextObject();
                notification.Init(sender, name, data);

                list.NotifyDelegates(notification);
                notification.Recycle();
            }
        }
示例#6
0
        public void Register(string name, NotificationDelegate del)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (del == null)
            {
                throw new NullReferenceException("del");
            }

            NotificationDelegateList list = FindList(name);

            if (list == null)
            {
                list = new NotificationDelegateList();
                m_registerMap [name] = list;
            }

            list.Add(del);
        }