Exemplo n.º 1
0
        public BoundSlot Subscribe(int group, GuiEventHandler <EventArgs> slot)
        {
            var c = new BoundSlot(group, slot, this);

            _slots.Add(group, c);
            return(c);
        }
Exemplo n.º 2
0
        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);
            }
        }