Пример #1
0
        protected void AddEvent(EventBean theEvent)
        {
            _array = null;

            if (!RefSet.TryGetValue(theEvent, out var value))
            {
                RefSet.Put(theEvent, 1);
                return;
            }

            value++;
            RefSet.Put(theEvent, value);
        }
Пример #2
0
        protected void RemoveEvent(EventBean theEvent)
        {
            _array = null;

            if (!RefSet.TryGetValue(theEvent, out var value)) return;

            if (value == 1)
            {
                RefSet.Remove(theEvent);
                return;
            }

            value--;
            RefSet.Put(theEvent, value);
        }