From 851b460a323c5635ada8fa8df2b228770ca349d4 Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Wed, 20 Mar 2019 00:40:27 +0100 Subject: [PATCH] renamed class --- .../{Tools.SystemMenu.cs => WindowMenu.cs} | 6 ++-- mRemoteV1/UI/Forms/frmMain.Designer.cs | 4 +-- mRemoteV1/UI/Forms/frmMain.cs | 10 +++---- ...ionSystemMenu.cs => AdvancedWindowMenu.cs} | 30 +++++++++---------- mRemoteV1/mRemoteV1.csproj | 4 +-- 5 files changed, 27 insertions(+), 27 deletions(-) rename mRemoteV1/Tools/{Tools.SystemMenu.cs => WindowMenu.cs} (96%) rename mRemoteV1/UI/Menu/{ScreenSelectionSystemMenu.cs => AdvancedWindowMenu.cs} (63%) diff --git a/mRemoteV1/Tools/Tools.SystemMenu.cs b/mRemoteV1/Tools/WindowMenu.cs similarity index 96% rename from mRemoteV1/Tools/Tools.SystemMenu.cs rename to mRemoteV1/Tools/WindowMenu.cs index 13a11ac44..c4518fff6 100644 --- a/mRemoteV1/Tools/Tools.SystemMenu.cs +++ b/mRemoteV1/Tools/WindowMenu.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Drawing; using mRemoteNG.App; using Microsoft.Win32.SafeHandles; @@ -7,7 +7,7 @@ using Microsoft.Win32.SafeHandles; namespace mRemoteNG.Tools { - public sealed class SystemMenu : SafeHandleZeroOrMinusOneIsInvalid, IDisposable + public sealed class WindowMenu : SafeHandleZeroOrMinusOneIsInvalid, IDisposable { [Flags] public enum Flags @@ -24,7 +24,7 @@ namespace mRemoteNG.Tools internal IntPtr SystemMenuHandle; private readonly IntPtr FormHandle; - public SystemMenu(IntPtr Handle) : base(true) + public WindowMenu(IntPtr Handle) : base(true) { FormHandle = Handle; SystemMenuHandle = NativeMethods.GetSystemMenu(FormHandle, false); diff --git a/mRemoteV1/UI/Forms/frmMain.Designer.cs b/mRemoteV1/UI/Forms/frmMain.Designer.cs index dc8c75a75..a3db7a305 100644 --- a/mRemoteV1/UI/Forms/frmMain.Designer.cs +++ b/mRemoteV1/UI/Forms/frmMain.Designer.cs @@ -14,8 +14,8 @@ if(components != null) components.Dispose(); - if(_screenSystemMenu != null) - _screenSystemMenu.Dispose(); + if(_advancedWindowMenu != null) + _advancedWindowMenu.Dispose(); } } diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index e285d0876..99e5abf88 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -44,7 +44,7 @@ namespace mRemoteNG.UI.Forms private bool _usingSqlServer; private string _connectionsFileName; private bool _showFullPathInTitle; - private readonly ScreenSelectionSystemMenu _screenSystemMenu; + private readonly AdvancedWindowMenu _advancedWindowMenu; private ConnectionInfo _selectedConnection; private readonly IList _messageWriters = new List(); private readonly ThemeManager _themeManager; @@ -66,7 +66,7 @@ namespace mRemoteNG.UI.Forms vsToolStripExtender.DefaultRenderer = _toolStripProfessionalRenderer; ApplyTheme(); - _screenSystemMenu = new ScreenSelectionSystemMenu(this); + _advancedWindowMenu = new AdvancedWindowMenu(this); } #region Properties @@ -182,8 +182,8 @@ namespace mRemoteNG.UI.Forms Startup.Instance.CreateConnectionsProvider(messageCollector); - _screenSystemMenu.BuildScreenList(); - SystemEvents.DisplaySettingsChanged += _screenSystemMenu.OnDisplayChanged; + _advancedWindowMenu.BuildScreenList(); + SystemEvents.DisplaySettingsChanged += _advancedWindowMenu.OnDisplayChanged; ApplyLanguage(); Opacity = 1; @@ -535,7 +535,7 @@ namespace mRemoteNG.UI.Forms break; case NativeMethods.WM_SYSCOMMAND: - //var screen = _screenSystemMenu.GetScreenById(m.WParam.ToInt32()); + //var screen = _advancedWindowMenu.GetScreenById(m.WParam.ToInt32()); //if (screen != null) // Screens.SendFormToScreen(screen); break; diff --git a/mRemoteV1/UI/Menu/ScreenSelectionSystemMenu.cs b/mRemoteV1/UI/Menu/AdvancedWindowMenu.cs similarity index 63% rename from mRemoteV1/UI/Menu/ScreenSelectionSystemMenu.cs rename to mRemoteV1/UI/Menu/AdvancedWindowMenu.cs index 705557134..bd66e5e41 100644 --- a/mRemoteV1/UI/Menu/ScreenSelectionSystemMenu.cs +++ b/mRemoteV1/UI/Menu/AdvancedWindowMenu.cs @@ -5,14 +5,14 @@ using mRemoteNG.Tools; namespace mRemoteNG.UI.Menu { // This class creates new menu items to menu that appears when you right click the top of the app (where the window title is) - public class ScreenSelectionSystemMenu : IDisposable + public class AdvancedWindowMenu : IDisposable { - private readonly SystemMenu _systemMenu; + private readonly WindowMenu _windowMenu; private readonly int[] _sysMenSubItems = new int[51]; - public ScreenSelectionSystemMenu(IWin32Window boundControl) + public AdvancedWindowMenu(IWin32Window boundControl) { - _systemMenu = new SystemMenu(boundControl.Handle); + _windowMenu = new WindowMenu(boundControl.Handle); } public Screen GetScreenById(int id) @@ -34,28 +34,28 @@ namespace mRemoteNG.UI.Menu private void ResetScreenList() { - _systemMenu.Reset(); + _windowMenu.Reset(); } public void BuildScreenList() { - var popMen = _systemMenu.CreatePopupMenuItem(); + var popMen = _windowMenu.CreatePopupMenuItem(); for (var i = 0; i <= Screen.AllScreens.Length - 1; i++) { _sysMenSubItems[i] = 200 + i; - _systemMenu.AppendMenuItem(popMen, SystemMenu.Flags.MF_STRING, new IntPtr(_sysMenSubItems[i]), + _windowMenu.AppendMenuItem(popMen, WindowMenu.Flags.MF_STRING, new IntPtr(_sysMenSubItems[i]), Language.strScreen + " " + Convert.ToString(i + 1)); } - _systemMenu.InsertMenuItem(_systemMenu.SystemMenuHandle, 0, - SystemMenu.Flags.MF_POPUP | SystemMenu.Flags.MF_BYPOSITION, popMen, + _windowMenu.InsertMenuItem(_windowMenu.SystemMenuHandle, 0, + WindowMenu.Flags.MF_POPUP | WindowMenu.Flags.MF_BYPOSITION, popMen, Language.strSendTo); - _systemMenu.InsertMenuItem(_systemMenu.SystemMenuHandle, 1, - SystemMenu.Flags.MF_POPUP | SystemMenu.Flags.MF_BYPOSITION, new IntPtr(0), + _windowMenu.InsertMenuItem(_windowMenu.SystemMenuHandle, 1, + WindowMenu.Flags.MF_POPUP | WindowMenu.Flags.MF_BYPOSITION, new IntPtr(0), Language.ShowHideMenu); - _systemMenu.InsertMenuItem(_systemMenu.SystemMenuHandle, 2, - SystemMenu.Flags.MF_BYPOSITION | SystemMenu.Flags.MF_SEPARATOR, IntPtr.Zero, + _windowMenu.InsertMenuItem(_windowMenu.SystemMenuHandle, 2, + WindowMenu.Flags.MF_BYPOSITION | WindowMenu.Flags.MF_SEPARATOR, IntPtr.Zero, null); } @@ -63,8 +63,8 @@ namespace mRemoteNG.UI.Menu { if (!disposing) return; - if(_systemMenu != null) - _systemMenu.Dispose(); + if(_windowMenu != null) + _windowMenu.Dispose(); } public void Dispose() diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 7e7a1419b..2a63792b9 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -661,7 +661,7 @@ - + Component @@ -680,7 +680,7 @@ Component - + Component