ElectronNET API: Add platform support attributes

This commit is contained in:
softworkz
2025-11-14 09:44:01 +01:00
parent 8e8d88c48f
commit 0580942a59
11 changed files with 167 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Runtime.Versioning;
// ReSharper disable InconsistentNaming
@@ -15,6 +16,8 @@ namespace ElectronNET.API
/// <summary>
/// Emitted when the system is about to lock the screen.
/// </summary>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public event Action OnLockScreen
{
add => AddEvent(value);
@@ -24,6 +27,8 @@ namespace ElectronNET.API
/// <summary>
/// Emitted when the system is about to unlock the screen.
/// </summary>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public event Action OnUnLockScreen
{
add => AddEvent(value);
@@ -51,6 +56,8 @@ namespace ElectronNET.API
/// <summary>
/// Emitted when the system changes to AC power.
/// </summary>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public event Action OnAC
{
add => AddEvent(value);
@@ -60,6 +67,8 @@ namespace ElectronNET.API
/// <summary>
/// Emitted when system changes to battery power.
/// </summary>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public event Action OnBattery
{
add => AddEvent(value);
@@ -72,6 +81,8 @@ 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 => AddEvent(value);
@@ -104,4 +115,4 @@ namespace ElectronNET.API
}
}
}
}
}