mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-14 05:34:48 +00:00
ElectronNET API: Add platform support attributes
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user