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