using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
namespace ElectronNET.API
{
///
/// Communicate asynchronously from the main process to renderer processes.
///
public sealed class IpcMain
{
private static IpcMain _ipcMain;
internal IpcMain() { }
internal static IpcMain Instance
{
get
{
if(_ipcMain == null)
{
_ipcMain = new IpcMain();
}
return _ipcMain;
}
}
///
/// Listens to channel, when a new message arrives listener would be called with
/// listener(event, args...).
///
/// Channelname.
/// Callback Method.
public void On(string channel, Action