Ejemplo n.º 1
0
        public void Subscribe(PresenceAction action, Action <PresenceMessage> handler)
        {
            if ((_channel.State != ChannelState.Attached) && (_channel.State != ChannelState.Attaching))
            {
                _channel.Attach();
            }

            _handlers.Add(action.ToString(), new MessageHandlerAction <PresenceMessage>(handler));
        }
Ejemplo n.º 2
0
 public bool Unsubscribe(PresenceAction presenceAction, Action <PresenceMessage> handler)
 {
     return(_handlers.Remove(presenceAction.ToString(), handler.ToHandlerAction()));
 }