public void AddListener(Object owner, ComponentListenerDelegate d) { lock (Owners) { List <ComponentListenerDelegate> group = null; if (owner != null) { Owners.TryGetValue(owner, out group); } if (group == null) { group = new List <ComponentListenerDelegate>(); Owners.TryAdd(owner, group); } group.Add(d); } }
public void RemoveListener(Object owner, ComponentListenerDelegate d) { lock (Owners) { List <ComponentListenerDelegate> group = null; if (owner != null) { Owners.TryGetValue(owner, out group); if (group != null) { group.Remove(d); if (group.Count == 0) { Owners.TryRemove(owner, out group); } } } } }
public void AddListener(Object owner, ComponentListenerDelegate d) { ComponentListeners.AddListener(owner, d); }
public void RemoveListener(Object owner, ComponentListenerDelegate d) { ManagerListeners.RemoveListener(owner, d); }