Exemplo n.º 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.");
        }
Exemplo n.º 2
0
 internal void RaiseCustomCommandReceivedEvent(CustomCommand command)
 {
     CustomCommandReceived?.Invoke(this, new CustomCommandReceivedEventArgs(command));
 }
Exemplo n.º 3
0
 private void OnCustomCommandReceived(int commandId)
 {
     CustomCommandReceived?.Invoke(commandId);
 }