예제 #1
0
        public void Remove <T>(SCallback <T> value) where T : AbstractSMessage
        {
            var type = typeof(T);

            if (_handlers.ContainsKey(type))
            {
                ((SCallbackWrapper <T>)_handlers[type]).Remove(value);
            }
        }
예제 #2
0
        /// <summary>
        /// Just add new handler to selected event type
        /// </summary>
        /// <typeparam name="T">AbstractSMessage event</typeparam>
        /// <param name="value">Handler function</param>
        public void Add <T>(SCallback <T> value) where T : AbstractSMessage
        {
            var type = typeof(T);

            if (!_handlers.ContainsKey(type))
            {
                _handlers.Add(type, new SCallbackWrapper <T>());
            }
            ((SCallbackWrapper <T>)_handlers[type]).Add(value);
        }
예제 #3
0
 public void Add(SCallback <T> value)
 {
     _delegates += value;
 }
예제 #4
0
 public void Remove(SCallback <T> value)
 {
     _delegates -= value;
 }
예제 #5
0
 public static void SRemove <T>(SCallback <T> value) where T : AbstractSMessage
 {
     _instance.Remove(value);
 }
예제 #6
0
 public static void SAdd <T>(SCallback <T> value) where T : AbstractSMessage
 {
     _instance.Add(value);
 }