implement BrowserWindow-API functions

This commit is contained in:
Gregor Biswanger
2017-10-15 21:39:52 +02:00
parent 08b88e3adf
commit a4aa1dfae3
25 changed files with 1261 additions and 342 deletions

View File

@@ -12,16 +12,21 @@ namespace ElectronNET.WebApp.Controllers
Electron.IpcMain.On("SayHello", (args) => {
Electron.Notification.Show(new NotificationOptions("Hallo Robert","Nachricht von ASP.NET Core App"));
Electron.IpcMain.Send("Goodbye", "Elephant!");
Electron.IpcMain.Send(Electron.WindowManager.BrowserWindows.First(), "Goodbye", "Elephant!");
});
Electron.IpcMain.On("GetPath", async (args) =>
{
string pathName = await Electron.App.GetPathAsync(PathName.pictures);
Electron.IpcMain.Send("GetPathComplete", pathName);
var currentBrowserWindow = Electron.WindowManager.BrowserWindows.First();
Electron.WindowManager.BrowserWindows.First().Minimize();
await Electron.WindowManager.CreateWindowAsync("http://www.google.de");
string pathName = await Electron.App.GetPathAsync(PathName.pictures);
Electron.IpcMain.Send(currentBrowserWindow, "GetPathComplete", pathName);
currentBrowserWindow.Minimize();
await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions {
Title = "My second Window",
AutoHideMenuBar = true
},"http://www.google.de");
});