mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-09 02:07:47 +00:00
Added the API Power
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ElectronNET.API;
|
||||
using ElectronNET.API.Entities;
|
||||
using System;
|
||||
|
||||
namespace ElectronNET.WebApp.Controllers
|
||||
{
|
||||
@@ -6,7 +9,19 @@ namespace ElectronNET.WebApp.Controllers
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
if (HybridSupport.IsElectronActive)
|
||||
{
|
||||
Electron.PowerMonitor.OnLockScreen += () =>
|
||||
{
|
||||
Console.WriteLine("Screeen Bloqueado desde C#");
|
||||
};
|
||||
|
||||
Electron.PowerMonitor.OnUnLockScreen += () =>
|
||||
{
|
||||
Console.WriteLine("Desbloquedo desde C#");
|
||||
};
|
||||
}
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user