public BoundSlot Subscribe(int group, GuiEventHandler <EventArgs> slot) { var c = new BoundSlot(group, slot, this); _slots.Add(group, c); return(c); }
internal void Unsubscribe(BoundSlot slot) { // TODO: optimize this var curr = _slots.SelectMany(x => x.Value.Select(y => new Tuple <int, BoundSlot>(x.Key, y))) .SingleOrDefault(x => x.Item2 == slot); if (curr != null) { _slots.Remove(curr.Item1, curr.Item2); } }