Пример #1
0
        public void BindListener(TofuEvent evnt, Action <EventPayload> action, IEventContext evntContext)
        {
            if (_boundListeners == null)
            {
                _boundListeners = new Dictionary <TofuEvent, List <Action <EventPayload> > >();
            }

            if (!_boundListeners.ContainsKey(evnt))
            {
                _boundListeners.Add(evnt, new List <Action <EventPayload> >());
            }

            evntContext.ContextBindEventListener(evnt, this);
            _boundListeners[evnt].Add(action);
        }