public void Remove <T>(SCallback <T> value) where T : AbstractSMessage { var type = typeof(T); if (_handlers.ContainsKey(type)) { ((SCallbackWrapper <T>)_handlers[type]).Remove(value); } }
/// <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); }
public void Add(SCallback <T> value) { _delegates += value; }
public void Remove(SCallback <T> value) { _delegates -= value; }
public static void SRemove <T>(SCallback <T> value) where T : AbstractSMessage { _instance.Remove(value); }
public static void SAdd <T>(SCallback <T> value) where T : AbstractSMessage { _instance.Add(value); }