Exemple #1
0
 public void Unsubscribe(Channel type, PubSubDelegate d)
 {
     if (_dict.ContainsKey(type))
     {
         _dict[type] -= d;
     }
 }
Exemple #2
0
		public void Subscribe(Channel type, PubSubDelegate d) {
			PubSubDelegate del = null;
			if (_dict.TryGetValue(type, out del)) {
				_dict[type] -= d;
				_dict[type] += d;
			}
			else {
				del += d;
				_dict.Add(type, del);
			}
		}
Exemple #3
0
        public void Publish(Channel type, object sender, Hashtable data)
        {
            Signal s = new Signal(type, sender, data);

            PubSubDelegate del = null;

            if (_dict.TryGetValue(type, out del))
            {
                if (del != null)
                {
                    del(s);
                }
            }
        }
Exemple #4
0
        public void Subscribe(Channel type, PubSubDelegate d)
        {
            PubSubDelegate del = null;

            if (_dict.TryGetValue(type, out del))
            {
                _dict[type] -= d;
                _dict[type] += d;
            }
            else
            {
                del += d;
                _dict.Add(type, del);
            }
        }
Exemple #5
0
		public void Unsubscribe(Channel type, PubSubDelegate d) {
			if (_dict.ContainsKey(type)) {
				_dict[type] -= d;
			}
		}