mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-13 21:24:00 +00:00
Merge of theolivenbaum PR
This commit is contained in:
@@ -16,7 +16,7 @@ namespace ElectronNET.API
|
||||
public sealed class Menu : IMenu
|
||||
{
|
||||
private static Menu _menu;
|
||||
private static object _syncRoot = new object();
|
||||
private static readonly object _syncRoot = new();
|
||||
|
||||
internal Menu() { }
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace ElectronNET.API
|
||||
/// The menu items.
|
||||
/// </value>
|
||||
public IReadOnlyCollection<MenuItem> MenuItems { get { return _menuItems.AsReadOnly(); } }
|
||||
private List<MenuItem> _menuItems = new List<MenuItem>();
|
||||
private readonly List<MenuItem> _menuItems = new();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the application menu.
|
||||
@@ -76,7 +76,7 @@ namespace ElectronNET.API
|
||||
/// The context menu items.
|
||||
/// </value>
|
||||
public IReadOnlyDictionary<int, ReadOnlyCollection<MenuItem>> ContextMenuItems { get; internal set; }
|
||||
private Dictionary<int, List<MenuItem>> _contextMenuItems = new Dictionary<int, List<MenuItem>>();
|
||||
private readonly Dictionary<int, List<MenuItem>> _contextMenuItems = new();
|
||||
|
||||
/// <summary>
|
||||
/// Sets the context menu.
|
||||
@@ -114,7 +114,7 @@ namespace ElectronNET.API
|
||||
BridgeConnector.Emit("menu-contextMenuPopup", browserWindow.Id);
|
||||
}
|
||||
|
||||
private JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
private readonly JsonSerializer _jsonSerializer = new()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
NullValueHandling = NullValueHandling.Ignore
|
||||
|
||||
Reference in New Issue
Block a user