mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-15 13:45:09 +00:00
Merge of theolivenbaum PR
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Threading.Tasks;
|
||||
using ElectronNET.API.Interfaces;
|
||||
|
||||
@@ -12,6 +13,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when the system is about to lock the screen.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action OnLockScreen
|
||||
{
|
||||
add
|
||||
@@ -41,6 +44,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when the system is about to unlock the screen.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action OnUnLockScreen
|
||||
{
|
||||
add
|
||||
@@ -70,6 +75,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when the system is suspending.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action OnSuspend
|
||||
{
|
||||
add
|
||||
@@ -99,6 +106,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when system is resuming.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action OnResume
|
||||
{
|
||||
add
|
||||
@@ -128,6 +137,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when the system changes to AC power.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action OnAC
|
||||
{
|
||||
add
|
||||
@@ -157,6 +168,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when system changes to battery power.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action OnBattery
|
||||
{
|
||||
add
|
||||
@@ -190,6 +203,9 @@ namespace ElectronNET.API
|
||||
/// order for the app to exit cleanly.If `e.preventDefault()` is called, the app
|
||||
/// should exit as soon as possible by calling something like `app.quit()`.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("linux")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
|
||||
public event Action OnShutdown
|
||||
{
|
||||
add
|
||||
@@ -217,7 +233,7 @@ namespace ElectronNET.API
|
||||
private event Action _shutdown;
|
||||
|
||||
private static PowerMonitor _powerMonitor;
|
||||
private static object _syncRoot = new object();
|
||||
private static readonly object _syncRoot = new();
|
||||
|
||||
internal PowerMonitor() { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user