Exemplo n.º 1
0
        public override void Execute(IEvent @event)
        {
            var token = @event.Data as JToken;

            if (token != null && ((string)token).Equals("toggle"))
            {
                _apiAdapter.ToggleRepeatMode();
            }

            var message = new SocketMessage(Constants.PlayerRepeat, _apiAdapter.GetRepeatMode());

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }
Exemplo n.º 2
0
        public override void Execute(IEvent receivedEvent)
        {
            if (receivedEvent == null)
            {
                throw new ArgumentNullException(nameof(receivedEvent));
            }

            if (receivedEvent.Data is JToken token &&
                ((string)token).Equals("toggle", StringComparison.InvariantCultureIgnoreCase))
            {
                _apiAdapter.ToggleRepeatMode();
            }

            var message = new SocketMessage(Constants.PlayerRepeat, _apiAdapter.GetRepeatMode());

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }