예제 #1
0
        public override void Execute(IEvent receivedEvent)
        {
            if (receivedEvent == null)
            {
                throw new ArgumentNullException(nameof(receivedEvent));
            }

            var success = false;
            var index   = -1;

            if (receivedEvent.Data is JToken token && token.Type == JTokenType.Integer)
            {
                index   = (int)token;
                success = _nowPlayingApiAdapter.RemoveIndex(index);
            }

            var reply = new { success, index };

            var message = new SocketMessage(Constants.NowPlayingListRemove, reply);

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }
예제 #2
0
        public override void Execute(IEvent @event)
        {
            var success = false;
            var token   = @event.Data as JToken;
            var index   = -1;

            if (token != null && token.Type == JTokenType.Integer)
            {
                index   = (int)token;
                success = _nowPlayingApiAdapter.RemoveIndex(index);
            }

            var reply = new
            {
                success,
                index
            };

            var message = new SocketMessage(Constants.NowPlayingListRemove, reply);

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