Create Electron-Class for API´s

This commit is contained in:
Gregor Biswanger
2017-10-14 17:58:16 +02:00
parent 9848a38b0d
commit 9abece156f
7 changed files with 281 additions and 238 deletions

View File

@@ -1,8 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using ElectronNET.API;
using ElectronNET.API.Entities;
using System;
using System.IO;
namespace ElectronNET.WebApp.Controllers
{
@@ -10,24 +8,24 @@ namespace ElectronNET.WebApp.Controllers
{
public IActionResult Index()
{
App.IpcMain.On("SayHello", (args) => {
App.CreateNotification(new NotificationOptions
Electron.IpcMain.On("SayHello", (args) => {
Electron.App.CreateNotification(new NotificationOptions
{
Title = "Hallo Robert",
Body = "Nachricht von ASP.NET Core App"
});
App.IpcMain.Send("Goodbye", "Elephant!");
Electron.IpcMain.Send("Goodbye", "Elephant!");
});
App.IpcMain.On("GetPath", async (args) =>
Electron.IpcMain.On("GetPath", async (args) =>
{
string pathName = await App.GetPathAsync(PathName.pictures);
string pathName = await Electron.App.GetPathAsync(PathName.pictures);
//App.IpcMain.Send("GetPathComplete", pathName);
var result = await App.GetPathAsync(PathName.exe);
var result = await Electron.App.GetPathAsync(PathName.exe);
//var imagePath = Path.Combine(result, "Electron.png");
App.IpcMain.Send("GetPathComplete", result);
Electron.IpcMain.Send("GetPathComplete", result);
//var image = await App.GetFileIconAsync(result);