private static void RegisterCustomCommandReceivedEvent()
        {
            _customCommandCallback = (clientName, requestId, customCommand, bundleHandle, _) =>
            {
                CustomCommand command = null;
                if (bundleHandle != IntPtr.Zero)
                {
                    command = new CustomCommand(customCommand, new Bundle(new SafeBundleHandle(bundleHandle, true)));
                }
                else
                {
                    command = new CustomCommand(customCommand);
                }

                command.SetResponseInformation(clientName, requestId);

                CustomCommandReceived?.Invoke(null, new CustomCommandReceivedEventArgs(command));
            };
            Native.SetCustomCommandReceivedCb(Handle, _customCommandCallback).
            ThrowIfError("Failed to init CustomCommandReceived event.");
        }
        private void RegisterCustomCommandReceivedEvent()
        {
            _customCommandReceivedCallback = (serverName, requestId, customEvent, bundleHandle, _) =>
            {
                CustomCommand command = null;
                if (bundleHandle != IntPtr.Zero)
                {
                    command = new CustomCommand(customEvent, new Bundle(new SafeBundleHandle(bundleHandle, true)));
                }
                else
                {
                    command = new CustomCommand(customEvent);
                }

                command.SetResponseInformation(serverName, requestId);

                GetController(serverName)?.RaiseCustomCommandReceivedEvent(command);
            };

            Native.SetCustomEventCb(Handle, _customCommandReceivedCallback).
            ThrowIfError("Failed to register CustomCommandReceived event.");
        }
Esempio n. 3
0
 internal void RaiseCustomCommandReceivedEvent(CustomCommand command)
 {
     CustomCommandReceived?.Invoke(this, new CustomCommandReceivedEventArgs(command));
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomCommandReceivedEventArgs"/> class.
 /// </summary>
 /// <param name="command">The playback position command.</param>
 /// <exception cref="ArgumentNullException"><paramref name="command"/> is null.</exception>
 /// <since_tizen> 5 </since_tizen>
 public CustomCommandReceivedEventArgs(CustomCommand command)
 {
     Command = command ?? throw new ArgumentNullException(nameof(command));
 }