Merge of theolivenbaum PR

This commit is contained in:
Gregor Biswanger
2022-07-28 11:51:18 +02:00
185 changed files with 6155 additions and 6135 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using ElectronNET.API.Entities;
using ElectronNET.API.Extensions;
@@ -12,7 +13,7 @@ namespace ElectronNET.API
public sealed class NativeTheme : INativeTheme
{
private static NativeTheme _nativeTheme;
private static object _syncRoot = new object();
private static readonly object _syncRoot = new();
internal NativeTheme() { }
@@ -115,12 +116,16 @@ namespace ElectronNET.API
/// A <see cref="bool"/> for if the OS / Chromium currently has high-contrast mode enabled or is
/// being instructed to show a high-contrast UI.
/// </summary>
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("macos")]
public Task<bool> ShouldUseHighContrastColorsAsync() => BridgeConnector.OnResult<bool>("nativeTheme-shouldUseHighContrastColors", "nativeTheme-shouldUseHighContrastColors-completed");
/// <summary>
/// A <see cref="bool"/> for if the OS / Chromium currently has an inverted color scheme or is
/// being instructed to use an inverted color scheme.
/// </summary>
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("macos")]
public Task<bool> ShouldUseInvertedColorSchemeAsync() => BridgeConnector.OnResult<bool>("nativeTheme-shouldUseInvertedColorScheme", "nativeTheme-shouldUseInvertedColorScheme-completed");
/// <summary>