コード例 #1
0
        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.");
        }
コード例 #2
0
        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.");
        }
コード例 #3
0
 internal void RaiseCustomCommandReceivedEvent(CustomCommand command)
 {
     CustomCommandReceived?.Invoke(this, new CustomCommandReceivedEventArgs(command));
 }
コード例 #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));
 }