diff --git a/ElectronNET.API/App.cs b/ElectronNET.API/App.cs
index 5376045..cf23444 100644
--- a/ElectronNET.API/App.cs
+++ b/ElectronNET.API/App.cs
@@ -603,7 +603,7 @@ namespace ElectronNET.API
}
private static App _app;
- private static object _syncRoot = new object();
+ private static readonly object _syncRoot = new();
///
/// Try to close all windows. The event will be emitted first. If all windows are successfully
@@ -1376,7 +1376,7 @@ namespace ElectronNET.API
///
public void DestroySplashScreen() => BridgeConnector.Emit("splashscreen-destroy");
- private readonly JsonSerializer _jsonSerializer = new JsonSerializer()
+ private readonly JsonSerializer _jsonSerializer = new()
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
diff --git a/ElectronNET.API/AutoUpdater.cs b/ElectronNET.API/AutoUpdater.cs
index d21ed04..038981c 100644
--- a/ElectronNET.API/AutoUpdater.cs
+++ b/ElectronNET.API/AutoUpdater.cs
@@ -313,7 +313,7 @@ namespace ElectronNET.API
private event Action _updateDownloaded;
private static AutoUpdater _autoUpdater;
- private static object _syncRoot = new object();
+ private static readonly object _syncRoot = new();
internal AutoUpdater() { }
diff --git a/ElectronNET.API/BridgeConnector.cs b/ElectronNET.API/BridgeConnector.cs
index b71708a..b0ad6e0 100644
--- a/ElectronNET.API/BridgeConnector.cs
+++ b/ElectronNET.API/BridgeConnector.cs
@@ -86,12 +86,12 @@ namespace ElectronNET.API
private static SocketIO _socket;
- private static object _syncRoot = new object();
+ private static readonly object _syncRoot = new();
- private static SemaphoreSlim _socketSemaphoreEmit = new SemaphoreSlim(1, 1);
- private static SemaphoreSlim _socketSemaphoreHandlers = new SemaphoreSlim(1, 1);
+ private static readonly SemaphoreSlim _socketSemaphoreEmit = new(1, 1);
+ private static readonly SemaphoreSlim _socketSemaphoreHandlers = new(1, 1);
- private static TaskCompletionSource _connectedSocketTask = new TaskCompletionSource();
+ private static TaskCompletionSource _connectedSocketTask = new();
private static Task _waitForConnection
{
diff --git a/ElectronNET.API/BrowserWindow.cs b/ElectronNET.API/BrowserWindow.cs
index fb5c1e4..986b10e 100644
--- a/ElectronNET.API/BrowserWindow.cs
+++ b/ElectronNET.API/BrowserWindow.cs
@@ -1106,7 +1106,6 @@ namespace ElectronNET.API
/// sum any extra width and height areas you have within the overall content view.
///
/// The aspect ratio to maintain for some portion of the content view.
- /// The extra size not to be included while maintaining the aspect ratio.
public void SetAspectRatio(int aspectRatio)
{
BridgeConnector.Emit("browserWindowSetAspectRatio", Id, aspectRatio, new Size() { Height = 0, Width = 0 });
@@ -1524,7 +1523,7 @@ namespace ElectronNET.API
// https://github.com/electron/electron/issues/4045
if (isWindows10())
{
- x = x - 7;
+ x -= 7;
}
BridgeConnector.Emit("browserWindowSetPosition", Id, x, y);
@@ -1543,7 +1542,7 @@ namespace ElectronNET.API
// https://github.com/electron/electron/issues/4045
if (isWindows10())
{
- x = x - 7;
+ x -= 7;
}
BridgeConnector.Emit("browserWindowSetPosition", Id, x, y, animate);
@@ -1747,7 +1746,7 @@ namespace ElectronNET.API
/// The menu items.
///
public IReadOnlyCollection