2017-10-21 04:37:01 +02:00
|
|
|
|
using ElectronNET.API;
|
|
|
|
|
|
using ElectronNET.API.Entities;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ElectronNET.WebApp.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ShellController : Controller
|
|
|
|
|
|
{
|
|
|
|
|
|
public IActionResult Index()
|
|
|
|
|
|
{
|
2017-10-23 21:24:05 +02:00
|
|
|
|
if (HybridSupport.IsElectronActive)
|
|
|
|
|
|
{
|
|
|
|
|
|
Electron.IpcMain.On("open-file-manager", async (args) =>
|
|
|
|
|
|
{
|
2020-05-31 03:09:54 +02:00
|
|
|
|
string path = await Electron.App.GetPathAsync(PathName.Home);
|
2017-10-23 21:24:05 +02:00
|
|
|
|
await Electron.Shell.ShowItemInFolderAsync(path);
|
2017-10-21 04:37:01 +02:00
|
|
|
|
|
2017-10-23 21:24:05 +02:00
|
|
|
|
});
|
2017-10-21 04:37:01 +02:00
|
|
|
|
|
2017-10-23 21:24:05 +02:00
|
|
|
|
Electron.IpcMain.On("open-ex-links", async (args) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
await Electron.Shell.OpenExternalAsync("https://github.com/ElectronNET");
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2017-10-21 04:37:01 +02:00
|
|
|
|
|
|
|
|
|
|
return View();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|