Ejemplo n.º 1
0
        public void PostImmediately(Notification notification)
        {
            string name = notification.Name;
            NotificationDelegateList list = FindList(name);

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

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

            return(false);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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);
        }