Пример #1
0
        public void AddHandler(string eventKey, EventHandler <SignaledEventArgs> handler)
        {
            EventHandler <SignaledEventArgs> traceHandler = (sender, e) => {
                TraceHelper.WriteTrace("Bus", e.EventKey, "Signal Received");
                handler(sender, e);
            };

            if (_cache.TryAdd(Tuple.Create(eventKey, handler), traceHandler))
            {
                _bus.AddHandler(eventKey, traceHandler);
            }
        }