mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Removed static reference to SystemMenu from Runtime. The only references to it were in frmMain
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user