-
-
Notifications
You must be signed in to change notification settings - Fork 739
ElectronNET.API: Add platform support attributes #929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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; | ||||||||||
|
|
@@ -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()); | ||||||||||
|
|
@@ -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")] | ||||||||||
|
||||||||||
| public event Action<string> OpenFile | ||||||||||
| { | ||||||||||
| add => AddEvent(value, GetHashCode()); | ||||||||||
|
|
@@ -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")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public event Action<string> OpenUrl | ||||||||||
| { | ||||||||||
| add => AddEvent(value, GetHashCode()); | ||||||||||
|
|
@@ -481,6 +486,7 @@ public void Focus(FocusOptions focusOptions) | |||||||||
| /// <summary> | ||||||||||
| /// Hides all application windows without minimizing them. | ||||||||||
| /// </summary> | ||||||||||
| [SupportedOSPlatform("macOS")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public void Hide() | ||||||||||
| { | ||||||||||
| this.CallMethod0(); | ||||||||||
|
|
@@ -489,6 +495,7 @@ public void Hide() | |||||||||
| /// <summary> | ||||||||||
| /// Shows application windows after they were hidden. Does not automatically focus them. | ||||||||||
| /// </summary> | ||||||||||
| [SupportedOSPlatform("macOS")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public void Show() | ||||||||||
| { | ||||||||||
| this.CallMethod0(); | ||||||||||
|
|
@@ -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")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public void AddRecentDocument(string path) | ||||||||||
| { | ||||||||||
| this.CallMethod1(path); | ||||||||||
|
|
@@ -594,6 +603,8 @@ public void AddRecentDocument(string path) | |||||||||
| /// <summary> | ||||||||||
| /// Clears the recent documents list. | ||||||||||
| /// </summary> | ||||||||||
| [SupportedOSPlatform("macOS")] | ||||||||||
| [SupportedOSPlatform("Windows")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public void ClearRecentDocuments() | ||||||||||
| { | ||||||||||
| this.CallMethod0(); | ||||||||||
|
|
@@ -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")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, CancellationToken cancellationToken = default) | ||||||||||
| { | ||||||||||
| return await this.RemoveAsDefaultProtocolClientAsync(protocol, null, null, cancellationToken).ConfigureAwait(false); | ||||||||||
|
|
@@ -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")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, string path, CancellationToken cancellationToken = default) | ||||||||||
| { | ||||||||||
| return await this.RemoveAsDefaultProtocolClientAsync(protocol, path, null, cancellationToken).ConfigureAwait(false); | ||||||||||
|
|
@@ -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")] | ||||||||||
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| public async Task<bool> RemoveAsDefaultProtocolClientAsync(string protocol, string path, string[] args, CancellationToken cancellationToken = default) | ||||||||||
| { | ||||||||||
| cancellationToken.ThrowIfCancellationRequested(); | ||||||||||
|
|
@@ -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")] | ||||||||||
|
||||||||||
| [SupportedOSPlatform("Windows")] | |
| [SupportedOSPlatform("windows")] |
FlorianRappl marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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'.
| [SupportedOSPlatform("Windows")] | |
| [SupportedOSPlatform("windows")] |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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'.
| [SupportedOSPlatform("macOS")] | |
| [SupportedOSPlatform("macos")] |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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'.
| [SupportedOSPlatform("Windows")] | |
| [SupportedOSPlatform("windows")] |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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'.
| [SupportedOSPlatform("Linux")] | |
| [SupportedOSPlatform("linux")] |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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'.
| [SupportedOSPlatform("Linux")] | |
| [SupportedOSPlatform("macOS")] | |
| [SupportedOSPlatform("linux")] | |
| [SupportedOSPlatform("macos")] |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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
AI
Nov 15, 2025
There was a problem hiding this comment.
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'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Uh oh!
There was an error while loading. Please reload this page.