mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-12 05:34:33 +00:00
27 lines
718 B
C#
27 lines
718 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ElectronNET.API;
|
|
using ElectronNET.API.Entities;
|
|
using System;
|
|
|
|
namespace ElectronNET.WebApp.Controllers
|
|
{
|
|
public class HomeController : Controller
|
|
{
|
|
public IActionResult Index()
|
|
{
|
|
if (HybridSupport.IsElectronActive)
|
|
{
|
|
Electron.PowerMonitor.OnLockScreen += () =>
|
|
{
|
|
Console.WriteLine("Screen Locked detected from C #");
|
|
};
|
|
|
|
Electron.PowerMonitor.OnUnLockScreen += () =>
|
|
{
|
|
Console.WriteLine("Screen unlocked detected from C # ");
|
|
};
|
|
}
|
|
return View();
|
|
}
|
|
}
|
|
} |