1. getWindowById(id) add undefined check

2. IpcMain add off
This commit is contained in:
yaofeng
2018-05-31 11:05:36 +08:00
parent 949741d992
commit 1bf274a73c
3 changed files with 55 additions and 62 deletions

View File

@@ -16,6 +16,7 @@ This package contains the API to access the "native" electron API.</Description>
<PackageTags>electron aspnetcore</PackageTags>
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/master/Changelog.md</PackageReleaseNotes>
<PackageIconUrl>https://raw.githubusercontent.com/ElectronNET/Electron.NET/master/assets/images/electron.net-logo-square.png</PackageIconUrl>
<Version>1.0.1</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -46,6 +46,7 @@ namespace ElectronNET.API
public void On(string channel, Action<object> listener)
{
BridgeConnector.Socket.Emit("registerIpcMainChannel", channel);
BridgeConnector.Socket.Off(channel);
BridgeConnector.Socket.On(channel, (args) =>
{
List<object> objectArray = FormatArguments(args);