mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-17 14:16:15 +00:00
implement Demo App sections: Dialogs, Menu, Tray, Shell, CrashHang, Notification, Shortcuts etc. Fix some API bugs and implement GlobalShortcut-, Shell- and WebContents-API.
This commit is contained in:
25
ElectronNET.WebApp/Controllers/IpcController.cs
Normal file
25
ElectronNET.WebApp/Controllers/IpcController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ElectronNET.API;
|
||||
using System.Linq;
|
||||
|
||||
namespace ElectronNET.WebApp.Controllers
|
||||
{
|
||||
public class IpcController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
Electron.IpcMain.On("async-msg", (args) =>
|
||||
{
|
||||
var mainWindow = Electron.WindowManager.BrowserWindows.First();
|
||||
Electron.IpcMain.Send(mainWindow, "asynchronous-reply", "pong");
|
||||
});
|
||||
|
||||
Electron.IpcMain.OnSync("sync-msg", (args) =>
|
||||
{
|
||||
return "pong";
|
||||
});
|
||||
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user