From f6daa3b5dca6419051272b60380a6a85189401ae Mon Sep 17 00:00:00 2001 From: David Sparer Date: Tue, 24 May 2016 20:07:25 -0600 Subject: [PATCH] Removed static reference to SystemMenu from Runtime. The only references to it were in frmMain --- mRemoteV1/App/Runtime.cs | 2 -- mRemoteV1/UI/Forms/frmMain.cs | 15 ++++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mRemoteV1/App/Runtime.cs b/mRemoteV1/App/Runtime.cs index d2b49702..f85a5d44 100644 --- a/mRemoteV1/App/Runtime.cs +++ b/mRemoteV1/App/Runtime.cs @@ -55,8 +55,6 @@ namespace mRemoteNG.App public static Tools.Controls.NotificationAreaIcon NotificationAreaIcon { get; set; } - public static SystemMenu SystemMenu { get; set; } - public static bool IsConnectionsFileLoaded { get; set; } public static SqlConnectionsProvider SQLConnProvider { get; set; } diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 31e31008..a9b7d5a5 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -36,6 +36,7 @@ namespace mRemoteNG.UI.Forms private string _connectionsFileName = null; private bool _showFullPathInTitle; private ConnectionInfo _selectedConnection = null; + private SystemMenu _systemMenu; public MiscTools.Fullscreen _fullscreen; @@ -1224,24 +1225,24 @@ namespace mRemoteNG.UI.Forms AddSysMenuItems(); } - private static void ResetSysMenuItems() + private void ResetSysMenuItems() { - Runtime.SystemMenu.Reset(); + _systemMenu.Reset(); } private void AddSysMenuItems() { - Runtime.SystemMenu = new SystemMenu(Handle); - var popMen = Runtime.SystemMenu.CreatePopupMenuItem(); + _systemMenu = new SystemMenu(Handle); + var popMen = _systemMenu.CreatePopupMenuItem(); for (var i = 0; i <= Screen.AllScreens.Length - 1; i++) { SysMenSubItems[i] = 200 + i; - Runtime.SystemMenu.AppendMenuItem(popMen, SystemMenu.Flags.MF_STRING, new IntPtr(SysMenSubItems[i]), Language.strScreen + " " + Convert.ToString(i + 1)); + _systemMenu.AppendMenuItem(popMen, SystemMenu.Flags.MF_STRING, new IntPtr(SysMenSubItems[i]), Language.strScreen + " " + Convert.ToString(i + 1)); } - Runtime.SystemMenu.InsertMenuItem(Runtime.SystemMenu.SystemMenuHandle, 0, SystemMenu.Flags.MF_POPUP | SystemMenu.Flags.MF_BYPOSITION, popMen, Language.strSendTo); - Runtime.SystemMenu.InsertMenuItem(Runtime.SystemMenu.SystemMenuHandle, 1, SystemMenu.Flags.MF_BYPOSITION | SystemMenu.Flags.MF_SEPARATOR, IntPtr.Zero, null); + _systemMenu.InsertMenuItem(_systemMenu.SystemMenuHandle, 0, SystemMenu.Flags.MF_POPUP | SystemMenu.Flags.MF_BYPOSITION, popMen, Language.strSendTo); + _systemMenu.InsertMenuItem(_systemMenu.SystemMenuHandle, 1, SystemMenu.Flags.MF_BYPOSITION | SystemMenu.Flags.MF_SEPARATOR, IntPtr.Zero, null); } #endregion