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:
Gregor Biswanger
2017-10-21 04:37:01 +02:00
parent 9046f6ca25
commit 248ddde82b
61 changed files with 2505 additions and 57 deletions

View File

@@ -0,0 +1,34 @@
using Microsoft.AspNetCore.Mvc;
using ElectronNET.API;
using ElectronNET.API.Entities;
namespace ElectronNET.WebApp.Controllers
{
public class TrayController : Controller
{
public IActionResult Index()
{
Electron.IpcMain.On("put-in-tray", (args) => {
if (Electron.Tray.Items.Count == 0)
{
var menu = new MenuItem
{
Label = "Remove",
Click = () => Electron.Tray.Destroy()
};
Electron.Tray.Show("/Assets/electron_32x32.png", menu);
Electron.Tray.SetToolTip("Electron Demo in the tray.");
}
else
{
Electron.Tray.Destroy();
}
});
return View();
}
}
}