using System; namespace ElectronNET.API.Interfaces { /// /// Communicate asynchronously from the main process to renderer processes. /// public interface IIpcMain { /// /// Listens to channel, when a new message arrives listener would be called with /// listener(event, args...). /// /// Channelname. /// Callback Method. void On(string channel, Action listener); /// /// Send a message to the renderer process synchronously via channel, /// you can also send arbitrary arguments. /// /// Note: Sending a synchronous message will block the whole renderer process, /// unless you know what you are doing you should never use it. /// /// /// void OnSync(string channel, Func listener); /// /// Adds a one time listener method for the event. This listener is invoked only /// the next time a message is sent to channel, after which it is removed. /// /// Channelname. /// Callback Method. void Once(string channel, Action listener); /// /// Removes listeners of the specified channel. /// /// Channelname. void RemoveAllListeners(string channel); /// /// Send a message to the renderer process asynchronously via channel, you can also send /// arbitrary arguments. Arguments will be serialized in JSON internally and hence /// no functions or prototype chain will be included. The renderer process handles it by /// listening for channel with ipcRenderer module. /// /// BrowserWindow with channel. /// Channelname. /// Arguments data. void Send(BrowserWindow browserWindow, string channel, params object[] data); /// /// Send a message to the BrowserView renderer process asynchronously via channel, you can also send /// arbitrary arguments. Arguments will be serialized in JSON internally and hence /// no functions or prototype chain will be included. The renderer process handles it by /// listening for channel with ipcRenderer module. /// /// BrowserView with channel. /// Channelname. /// Arguments data. void Send(BrowserView browserView, string channel, params object[] data); } }