implement enum for types, implement OpenDialog from Dialog-API

This commit is contained in:
Gregor Biswanger
2017-10-17 05:12:35 +02:00
parent 2bace2d215
commit b28fa9465a
31 changed files with 527 additions and 38 deletions

View File

@@ -9,10 +9,21 @@ namespace ElectronNET.WebApp.Controllers
{
public IActionResult Index()
{
Electron.IpcMain.On("SayHello", (args) => {
Electron.Notification.Show(new NotificationOptions("Hallo Robert","Nachricht von ASP.NET Core App"));
Electron.IpcMain.On("SayHello", async (args) =>
{
Electron.Notification.Show(new NotificationOptions("Hallo Robert", "Nachricht von ASP.NET Core App"));
Electron.IpcMain.Send(Electron.WindowManager.BrowserWindows.First(), "Goodbye", "Elephant!");
var currentBrowserWindow = Electron.WindowManager.BrowserWindows.First();
var openDialogOptions = new OpenDialogOptions
{
Title = "Wuhuuu",
ButtonLabel = "Mhh Okay",
DefaultPath = await Electron.App.GetPathAsync(PathName.pictures),
Message = "Hello World",
Properties = new OpenDialogProperty[] { OpenDialogProperty.openDirectory }
};
var filePaths = await Electron.Dialog.ShowOpenDialogAsync(currentBrowserWindow, openDialogOptions);
});
Electron.IpcMain.On("GetPath", async (args) =>