コード例 #1
0
        public void Execute(IEvent @event)
        {
            var message = new SocketMessage(Constants.PlayerOutput, _apiAdapter.GetOutputDevices())
            {
                NewLineTerminated = true
            };

            _hub.Publish(new PluginResponseAvailableEvent(message, @event.ConnectionId));
        }
コード例 #2
0
        public void Execute(IEvent receivedEvent)
        {
            if (receivedEvent == null)
            {
                throw new ArgumentNullException(nameof(receivedEvent));
            }

            var message = new SocketMessage(Constants.PlayerOutput, _apiAdapter.GetOutputDevices())
            {
                NewLineTerminated = true,
            };

            _hub.Publish(new PluginResponseAvailableEvent(message, receivedEvent.ConnectionId));
        }
コード例 #3
0
        public void Execute(IEvent @event)
        {
            var token = @event.Data as JToken;

            if (token != null && token.Type == JTokenType.String)
            {
                var device       = (string)token;
                var outputDevice = _apiAdapter.SetOutputDevice(device);
            }

            var message = new SocketMessage(Constants.PlayerOutput, _apiAdapter.GetOutputDevices())
            {
                NewLineTerminated = true
            };

            _hub.Publish(new PluginResponseAvailableEvent(message, @event.ConnectionId));
        }
コード例 #4
0
        public void Execute(IEvent receivedEvent)
        {
            if (receivedEvent == null)
            {
                throw new ArgumentNullException(nameof(receivedEvent));
            }

            if (receivedEvent.Data is JToken token && token.Type == JTokenType.String)
            {
                var device = (string)token;
                _apiAdapter.SetOutputDevice(device);
            }

            var message = new SocketMessage(Constants.PlayerOutput, _apiAdapter.GetOutputDevices())
            {
                NewLineTerminated = true,
            };

            _hub.Publish(new PluginResponseAvailableEvent(message, receivedEvent.ConnectionId));
        }