Exemplo n.º 1
0
        public override void Execute(IEvent receivedEvent)
        {
            if (receivedEvent == null)
            {
                throw new ArgumentNullException(nameof(receivedEvent));
            }

            bool isToggle = receivedEvent.Data is JToken token && ((string)token).Equals("toggle", StringComparison.InvariantCultureIgnoreCase);

            if (isToggle)
            {
                _apiAdapter.ToggleMute();
            }

            var message = new SocketMessage(Constants.PlayerMute, _apiAdapter.IsMuted());

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }
Exemplo n.º 2
0
        public override void Execute(IEvent @event)
        {
            var isToggle = false;
            var token    = @event.Data as JToken;

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

            if (isToggle)
            {
                _apiAdapter.ToggleMute();
            }

            var message = new SocketMessage(Constants.PlayerMute, _apiAdapter.IsMuted());

            _hub.Publish(new PluginResponseAvailableEvent(message));
        }
Exemplo n.º 3
0
        private void SendMuteState()
        {
            var muteMessages = new SocketMessage(Constants.PlayerMute, _apiAdapter.IsMuted());

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