Пример #1
0
        private static void RegisterPlaybackActionCommandReceivedEvent()
        {
            _playbackActionCommandCallback = (clientName, requestId, playbackCommand, _) =>
            {
                var command = new PlaybackCommand(playbackCommand.ToPublic());
                command.SetResponseInformation(clientName, requestId);

                PlaybackActionCommandReceived?.Invoke(null, new PlaybackActionCommandReceivedEventArgs(command));
            };
            Native.SetPlaybackActionCommandReceivedCb(Handle, _playbackActionCommandCallback).
            ThrowIfError("Failed to init PlaybackActionCommandReceived event.");
        }
Пример #2
0
        private static void RegisterPlaybackActionCommandReceivedEvent()
        {
            _playbackActionCommandCallback = (clientName, requestId, playbackCommand, _) =>
            {
                // SendPlaybackCommand doesn't use requestId. It'll be removed in Level 7.
                if (requestId == null)
                {
                    PlaybackCommandReceived?.Invoke(null, new PlaybackCommandReceivedEventArgs(clientName, playbackCommand.ToPublic()));
                }
                else
                {
                    var command = new PlaybackCommand(playbackCommand.ToPublic());
                    command.SetResponseInformation(clientName, requestId);

                    PlaybackActionCommandReceived?.Invoke(null, new PlaybackActionCommandReceivedEventArgs(command));
                }
            };
            Native.SetPlaybackActionCommandReceivedCb(Handle, _playbackActionCommandCallback).
            ThrowIfError("Failed to init PlaybackActionCommandReceived event.");
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaybackActionCommandReceivedEventArgs"/> class.
 /// </summary>
 /// <param name="command">The playback command.</param>
 /// <exception cref="ArgumentNullException"><paramref name="command"/> is null.</exception>
 /// <since_tizen> 5 </since_tizen>
 public PlaybackActionCommandReceivedEventArgs(PlaybackCommand command)
 {
     Command = command ?? throw new ArgumentNullException(nameof(command));
 }