Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/ElectronNET.API/API/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using ElectronNET.API.Extensions;
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -259,6 +260,8 @@ public event Action WebContentsCreated
/// screen readers, are enabled or disabled. See https://www.chromium.org/developers/design-documents/accessibility for more details.
/// </summary>
/// <returns><see langword="true"/> when Chrome's accessibility support is enabled, <see langword="false"/> otherwise.</returns>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public event Action<bool> AccessibilitySupportChanged
{
add => AddEvent(value, GetHashCode());
Expand Down Expand Up @@ -316,6 +319,7 @@ internal set
/// <para/>
/// On Windows, you have to parse the arguments using App.CommandLine to get the filepath.
/// </summary>
[SupportedOSPlatform("macOS")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'macOS' to 'macos'.

Copilot uses AI. Check for mistakes.
public event Action<string> OpenFile
{
add => AddEvent(value, GetHashCode());
Expand All @@ -327,6 +331,7 @@ public event Action<string> OpenFile
/// Emitted when a MacOS user wants to open a URL with the application. Your application's Info.plist file must
/// define the URL scheme within the CFBundleURLTypes key, and set NSPrincipalClass to AtomApplication.
/// </summary>
[SupportedOSPlatform("macOS")]
public event Action<string> OpenUrl
{
add => AddEvent(value, GetHashCode());
Expand Down Expand Up @@ -481,6 +486,7 @@ public void Focus(FocusOptions focusOptions)
/// <summary>
/// Hides all application windows without minimizing them.
/// </summary>
[SupportedOSPlatform("macOS")]
public void Hide()
{
this.CallMethod0();
Expand All @@ -489,6 +495,7 @@ public void Hide()
/// <summary>
/// Shows application windows after they were hidden. Does not automatically focus them.
/// </summary>
[SupportedOSPlatform("macOS")]
public void Show()
{
this.CallMethod0();
Expand Down Expand Up @@ -586,6 +593,8 @@ public async Task<string> GetLocaleAsync(CancellationToken cancellationToken = d
/// list from the task bar, and on macOS you can visit it from dock menu.
/// </summary>
/// <param name="path">Path to add.</param>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public void AddRecentDocument(string path)
{
this.CallMethod1(path);
Expand All @@ -594,6 +603,8 @@ public void AddRecentDocument(string path)
/// <summary>
/// Clears the recent documents list.
/// </summary>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public void ClearRecentDocuments()
{
this.CallMethod0();
Expand Down Expand Up @@ -709,6 +720,8 @@ public async Task<bool> SetAsDefaultProtocolClientAsync(string protocol, string
/// <param name="protocol">The name of your protocol, without ://.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Whether the call succeeded.</returns>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, CancellationToken cancellationToken = default)
{
return await this.RemoveAsDefaultProtocolClientAsync(protocol, null, null, cancellationToken).ConfigureAwait(false);
Expand All @@ -722,6 +735,8 @@ public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, Canc
/// <param name="path">Defaults to process.execPath.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Whether the call succeeded.</returns>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, string path, CancellationToken cancellationToken = default)
{
return await this.RemoveAsDefaultProtocolClientAsync(protocol, path, null, cancellationToken).ConfigureAwait(false);
Expand All @@ -736,6 +751,8 @@ public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, stri
/// <param name="args">Defaults to an empty array.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Whether the call succeeded.</returns>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand Down Expand Up @@ -826,6 +843,7 @@ public async Task<bool> IsDefaultProtocolClientAsync(string protocol, string pat
/// <param name="userTasks">Array of <see cref="UserTask"/> objects.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Whether the call succeeded.</returns>
[SupportedOSPlatform("Windows")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'Windows' to 'windows'.

Suggested change
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("windows")]

Copilot uses AI. Check for mistakes.
public async Task<bool> SetUserTasksAsync(UserTask[] userTasks, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -846,6 +864,7 @@ public async Task<bool> SetUserTasksAsync(UserTask[] userTasks, CancellationToke
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Jump List settings.</returns>
[SupportedOSPlatform("Windows")]
public async Task<JumpListSettings> GetJumpListSettingsAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -868,6 +887,7 @@ public async Task<JumpListSettings> GetJumpListSettingsAsync(CancellationToken c
/// omitted from the Jump List. The list of removed items can be obtained using <see cref="GetJumpListSettingsAsync"/>.
/// </summary>
/// <param name="categories">Array of <see cref="JumpListCategory"/> objects.</param>
[SupportedOSPlatform("Windows")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'Windows' to 'windows'.

Suggested change
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("windows")]

Copilot uses AI. Check for mistakes.
public void SetJumpList(JumpListCategory[] categories)
{
this.CallMethod1(categories);
Expand Down Expand Up @@ -950,6 +970,7 @@ public async Task<bool> HasSingleInstanceLockAsync(CancellationToken cancellatio
/// </summary>
/// <param name="type">Uniquely identifies the activity. Maps to <see href="https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType">NSUserActivity.activityType</see>.</param>
/// <param name="userInfo">App-specific state to store for use by another device.</param>
[SupportedOSPlatform("macOS")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'macOS' to 'macos'.

Suggested change
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("macos")]

Copilot uses AI. Check for mistakes.
public void SetUserActivity(string type, object userInfo)
{
SetUserActivity(type, userInfo, null);
Expand All @@ -967,6 +988,7 @@ public void SetUserActivity(string type, object userInfo)
/// <param name="webpageUrl">
/// The webpage to load in a browser if no suitable app is installed on the resuming device. The scheme must be http or https.
/// </param>
[SupportedOSPlatform("macOS")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'macOS' to 'macos'.

Copilot uses AI. Check for mistakes.
public void SetUserActivity(string type, object userInfo, string webpageUrl)
{
this.CallMethod3(type, userInfo, webpageUrl);
Expand All @@ -976,6 +998,7 @@ public void SetUserActivity(string type, object userInfo, string webpageUrl)
/// The type of the currently running activity.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
[SupportedOSPlatform("macOS")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'macOS' to 'macos'.

Copilot uses AI. Check for mistakes.
public async Task<string> GetCurrentActivityTypeAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -985,6 +1008,7 @@ public async Task<string> GetCurrentActivityTypeAsync(CancellationToken cancella
/// <summary>
/// Invalidates the current <see href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html">Handoff</see> user activity.
/// </summary>
[SupportedOSPlatform("macOS")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'macOS' to 'macos'.

Copilot uses AI. Check for mistakes.
public void InvalidateCurrentActivity()
{
this.CallMethod0();
Expand All @@ -993,6 +1017,7 @@ public void InvalidateCurrentActivity()
/// <summary>
/// Marks the current <see href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html">Handoff</see> user activity as inactive without invalidating it.
/// </summary>
[SupportedOSPlatform("macOS")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'macOS' to 'macos'.

Copilot uses AI. Check for mistakes.
public void ResignCurrentActivity()
{
this.CallMethod0();
Expand All @@ -1002,6 +1027,7 @@ public void ResignCurrentActivity()
/// Changes the <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx">Application User Model ID</see> to id.
/// </summary>
/// <param name="id">Model Id.</param>
[SupportedOSPlatform("Windows")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'Windows' to 'windows'.

Suggested change
[SupportedOSPlatform("Windows")]
[SupportedOSPlatform("windows")]

Copilot uses AI. Check for mistakes.
public void SetAppUserModelId(string id)
{
this.CallMethod1(id);
Expand All @@ -1016,6 +1042,7 @@ public void SetAppUserModelId(string id)
/// <param name="options"></param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Result of import. Value of 0 indicates success.</returns>
[SupportedOSPlatform("Linux")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'Linux' to 'linux'.

Suggested change
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("linux")]

Copilot uses AI. Check for mistakes.
public async Task<int> ImportCertificateAsync(ImportCertificateOptions options, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand Down Expand Up @@ -1067,6 +1094,8 @@ public async Task<GPUFeatureStatus> GetGpuFeatureStatusAsync(CancellationToken c
/// <param name="count">Counter badge.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Whether the call succeeded.</returns>
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
Comment on lines +1097 to +1098
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'Linux' to 'linux' and 'macOS' to 'macos'.

Suggested change
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]

Copilot uses AI. Check for mistakes.
public async Task<bool> SetBadgeCountAsync(int count, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -1086,6 +1115,8 @@ public async Task<bool> SetBadgeCountAsync(int count, CancellationToken cancella
/// The current value displayed in the counter badge.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
[SupportedOSPlatform("Linux")]
[SupportedOSPlatform("macOS")]
Comment on lines +1118 to +1119
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'Linux' to 'linux' and 'macOS' to 'macos'.

Copilot uses AI. Check for mistakes.
public async Task<int> GetBadgeCountAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -1101,6 +1132,7 @@ public async Task<int> GetBadgeCountAsync(CancellationToken cancellationToken =
/// Whether the current desktop environment is Unity launcher.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
[SupportedOSPlatform("Linux")]
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier string should use lowercase. Change 'Linux' to 'linux'.

Copilot uses AI. Check for mistakes.
public async Task<bool> IsUnityRunningAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -1111,6 +1143,8 @@ public async Task<bool> IsUnityRunningAsync(CancellationToken cancellationToken
/// If you provided path and args options to <see cref="SetLoginItemSettings"/> then you need to pass the same
/// arguments here for <see cref="LoginItemSettings.OpenAtLogin"/> to be set correctly.
/// </summary>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
Comment on lines +1146 to +1147
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'macOS' to 'macos' and 'Windows' to 'windows'.

Copilot uses AI. Check for mistakes.
public async Task<LoginItemSettings> GetLoginItemSettingsAsync(CancellationToken cancellationToken = default)
{
return await this.GetLoginItemSettingsAsync(null, cancellationToken).ConfigureAwait(false);
Expand All @@ -1122,6 +1156,8 @@ public async Task<LoginItemSettings> GetLoginItemSettingsAsync(CancellationToken
/// </summary>
/// <param name="options"></param>
/// <param name="cancellationToken">The cancellation token.</param>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
Comment on lines +1159 to +1160
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'macOS' to 'macos' and 'Windows' to 'windows'.

Copilot uses AI. Check for mistakes.
public async Task<LoginItemSettings> GetLoginItemSettingsAsync(LoginItemSettingsOptions options, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand Down Expand Up @@ -1151,6 +1187,8 @@ public async Task<LoginItemSettings> GetLoginItemSettingsAsync(LoginItemSettings
/// you'll want to set the launch path to Update.exe, and pass arguments that specify your application name.
/// </summary>
/// <param name="loginSettings"></param>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
Comment on lines +1190 to +1191
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'macOS' to 'macos' and 'Windows' to 'windows'.

Copilot uses AI. Check for mistakes.
public void SetLoginItemSettings(LoginSettings loginSettings)
{
this.CallMethod1(loginSettings);
Expand All @@ -1162,6 +1200,8 @@ public void SetLoginItemSettings(LoginSettings loginSettings)
/// See <see href="chromium.org/developers/design-documents/accessibility">Chromium's accessibility docs</see> for more details.
/// </summary>
/// <returns><see langword="true"/> if Chrome’s accessibility support is enabled, <see langword="false"/> otherwise.</returns>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
Comment on lines +1203 to +1204
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'macOS' to 'macos' and 'Windows' to 'windows'.

Copilot uses AI. Check for mistakes.
public async Task<bool> IsAccessibilitySupportEnabledAsync(CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -1178,6 +1218,8 @@ public async Task<bool> IsAccessibilitySupportEnabledAsync(CancellationToken can
/// Note: Rendering accessibility tree can significantly affect the performance of your app. It should not be enabled by default.
/// </summary>
/// <param name="enabled">Enable or disable <see href="https://developers.google.com/web/fundamentals/accessibility/semantics-builtin/the-accessibility-tree">accessibility tree</see> rendering.</param>
[SupportedOSPlatform("macOS")]
[SupportedOSPlatform("Windows")]
Comment on lines +1221 to +1222
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform identifier strings should use lowercase. Change 'macOS' to 'macos' and 'Windows' to 'windows'.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then explain this, you liar!

image

public void SetAccessibilitySupportEnabled(bool enabled)
{
this.CallMethod1(enabled);
Expand Down
Loading
Loading