Add supported OS platform annotations

This commit is contained in:
rafael-aero
2021-08-26 14:22:54 +02:00
parent 7ad6803671
commit 224bc1ef65
16 changed files with 294 additions and 13 deletions

View File

@@ -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);