mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-16 05:35:03 +00:00
Add supported OS platform annotations
This commit is contained in:
@@ -5,6 +5,7 @@ using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ElectronNET.API
|
||||
@@ -12,6 +13,9 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Add icons and context menus to the system's notification area.
|
||||
/// </summary>
|
||||
|
||||
[SupportedOSPlatform("macos")]
|
||||
[SupportedOSPlatform("windows")]
|
||||
public sealed class Tray
|
||||
{
|
||||
/// <summary>
|
||||
@@ -46,6 +50,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// macOS, Windows: Emitted when the tray icon is right clicked.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action<TrayClickEventArgs, Rectangle> OnRightClick
|
||||
{
|
||||
add
|
||||
@@ -75,6 +81,8 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// macOS, Windows: Emitted when the tray icon is double clicked.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
public event Action<TrayClickEventArgs, Rectangle> OnDoubleClick
|
||||
{
|
||||
add
|
||||
@@ -104,6 +112,7 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Windows: Emitted when the tray balloon shows.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public event Action OnBalloonShow
|
||||
{
|
||||
add
|
||||
@@ -133,6 +142,7 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Windows: Emitted when the tray balloon is clicked.
|
||||
/// </summary>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public event Action OnBalloonClick
|
||||
{
|
||||
add
|
||||
@@ -163,6 +173,8 @@ namespace ElectronNET.API
|
||||
/// Windows: Emitted when the tray balloon is closed
|
||||
/// because of timeout or user manually closes it.
|
||||
/// </summary>
|
||||
|
||||
[SupportedOSPlatform("windows")]
|
||||
public event Action OnBalloonClosed
|
||||
{
|
||||
add
|
||||
@@ -285,6 +297,7 @@ namespace ElectronNET.API
|
||||
/// Sets the image associated with this tray icon when pressed on macOS.
|
||||
/// </summary>
|
||||
/// <param name="image"></param>
|
||||
[SupportedOSPlatform("macos")]
|
||||
public void SetPressedImage(string image)
|
||||
{
|
||||
BridgeConnector.Emit("tray-setPressedImage", image);
|
||||
@@ -303,6 +316,7 @@ namespace ElectronNET.API
|
||||
/// macOS: Sets the title displayed aside of the tray icon in the status bar.
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
[SupportedOSPlatform("macos")]
|
||||
public void SetTitle(string title)
|
||||
{
|
||||
BridgeConnector.Emit("tray-setTitle", title);
|
||||
@@ -312,6 +326,7 @@ namespace ElectronNET.API
|
||||
/// Windows: Displays a tray balloon.
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
[SupportedOSPlatform("windows")]
|
||||
public void DisplayBalloon(DisplayBalloonOptions options)
|
||||
{
|
||||
BridgeConnector.Emit("tray-displayBalloon", options);
|
||||
|
||||
Reference in New Issue
Block a user