mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Electron.IpcMain.On doesn't allow for event parameter #649
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Zshandi on GitHub (Apr 14, 2021).
Originally assigned to: @GregorBiswanger on GitHub.
Inside my main process, I am trying to receive a signal from my renderer process using
IpcMain.On()and return a value back to the renderer process. The issue I am having is that I cannot access the event parameter inside of the callback function. I am receiving a compile time error stating that event is an "Invalid Expression term".I looked at the source code for
On()insideIpcMain.csand it doesn't seem to be calling the listener callback function with an event parameter.The comments say that the listener will be called as such:
But looking at the implementation, it doesn't seem to be calling the listener with the event parameter as it says it does:
In particular,
Action<object> listenerforces the listener to only take a single argument, andlistener(objectArray.First());orlistener(objectArray);only pass the argument object list, which doesn't include an event.Steps to Reproduce: