Files
Electron.NET/ElectronNET.WebApp/Controllers/HomeController.cs
2017-10-14 19:57:49 +02:00

30 lines
871 B
C#

using Microsoft.AspNetCore.Mvc;
using ElectronNET.API;
using ElectronNET.API.Entities;
namespace ElectronNET.WebApp.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
Electron.IpcMain.On("SayHello", (args) => {
Electron.App.CreateNotification(new NotificationOptions
{
Title = "Hallo Robert",
Body = "Nachricht von ASP.NET Core App"
});
Electron.IpcMain.Send("Goodbye", "Elephant!");
});
Electron.IpcMain.On("GetPath", async (args) =>
{
string pathName = await Electron.App.GetPathAsync(PathName.pictures);
Electron.IpcMain.Send("GetPathComplete", pathName);
});
return View();
}
}
}