mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-11 21:23:48 +00:00
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ElectronNET.API;
|
|
using ElectronNET.API.Entities;
|
|
using System.Linq;
|
|
|
|
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);
|
|
|
|
Electron.WindowManager.BrowserWindows.First().Minimize();
|
|
await Electron.WindowManager.CreateWindowAsync("http://www.google.de");
|
|
});
|
|
|
|
|
|
return View();
|
|
}
|
|
}
|
|
} |