forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShellController.cs
More file actions
29 lines (25 loc) · 820 Bytes
/
Copy pathShellController.cs
File metadata and controls
29 lines (25 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using ElectronNET.API;
using ElectronNET.API.Entities;
using Microsoft.AspNetCore.Mvc;
namespace ElectronNET.WebApp.Controllers
{
public class ShellController : Controller
{
public IActionResult Index()
{
if (HybridSupport.IsElectronActive)
{
Electron.IpcMain.On("open-file-manager", async (args) =>
{
string path = await Electron.App.GetPathAsync(PathName.home);
await Electron.Shell.ShowItemInFolderAsync(path);
});
Electron.IpcMain.On("open-ex-links", async (args) =>
{
await Electron.Shell.OpenExternalAsync("https://github.com/ElectronNET");
});
}
return View();
}
}
}