mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-13 13:44:57 +00:00
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:
27
ElectronNET.WebApp/Controllers/ShellController.cs
Normal file
27
ElectronNET.WebApp/Controllers/ShellController.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using ElectronNET.API;
|
||||
using ElectronNET.API.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ElectronNET.WebApp.Controllers
|
||||
{
|
||||
public class ShellController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user