diff --git a/src/Avalonia.FreeDesktop/DBusMenuExporter.cs b/src/Avalonia.FreeDesktop/DBusMenuExporter.cs index d5916348be..9e426688d8 100644 --- a/src/Avalonia.FreeDesktop/DBusMenuExporter.cs +++ b/src/Avalonia.FreeDesktop/DBusMenuExporter.cs @@ -37,16 +37,17 @@ namespace Avalonia.FreeDesktop { private readonly Connection _dbus; private readonly uint _xid; - private IRegistrar _registar; + private IRegistrar _registrar; private bool _disposed; private uint _revision = 1; private NativeMenu _menu; - private Dictionary _idsToItems = new Dictionary(); - private Dictionary _itemsToIds = new Dictionary(); + private readonly Dictionary _idsToItems = new Dictionary(); + private readonly Dictionary _itemsToIds = new Dictionary(); private readonly HashSet _menus = new HashSet(); private bool _resetQueued; private int _nextId = 1; - private bool AppMenu = true; + private bool _appMenu = true; + public DBusMenuExporterImpl(Connection dbus, IntPtr xid) { _dbus = dbus; @@ -59,7 +60,7 @@ namespace Avalonia.FreeDesktop public DBusMenuExporterImpl(Connection dbus, ObjectPath path) { _dbus = dbus; - AppMenu = false; + _appMenu = false; ObjectPath = path; SetNativeMenu(new NativeMenu()); Init(); @@ -69,14 +70,14 @@ namespace Avalonia.FreeDesktop { try { - if (AppMenu) + if (_appMenu) { await _dbus.RegisterObjectAsync(this); - _registar = DBusHelper.Connection.CreateProxy( + _registrar = DBusHelper.Connection.CreateProxy( "com.canonical.AppMenu.Registrar", "/com/canonical/AppMenu/Registrar"); if (!_disposed) - await _registar.RegisterWindowAsync(_xid, ObjectPath); + await _registrar.RegisterWindowAsync(_xid, ObjectPath); } else { @@ -102,7 +103,7 @@ namespace Avalonia.FreeDesktop _disposed = true; _dbus.UnregisterObject(this); // Fire and forget - _registar?.UnregisterWindowAsync(_xid); + _registrar?.UnregisterWindowAsync(_xid); }