renamed class

This commit is contained in:
Faryan Rezagholi
2019-03-20 00:40:27 +01:00
parent aca775a96e
commit 851b460a32
5 changed files with 27 additions and 27 deletions

View File

@@ -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);

View File

@@ -14,8 +14,8 @@
if(components != null)
components.Dispose();
if(_screenSystemMenu != null)
_screenSystemMenu.Dispose();
if(_advancedWindowMenu != null)
_advancedWindowMenu.Dispose();
}
}

View File

@@ -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<IMessageWriter> _messageWriters = new List<IMessageWriter>();
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;

View File

@@ -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()

View File

@@ -661,7 +661,7 @@
<Compile Include="Tools\Tools.LocalizedAttributes.cs" />
<Compile Include="Tools\MiscTools.cs" />
<Compile Include="Tools\PortScanner.cs" />
<Compile Include="Tools\Tools.SystemMenu.cs" />
<Compile Include="Tools\WindowMenu.cs" />
<Compile Include="Tools\Tools.WindowPlacement.cs" />
<Compile Include="UI\Forms\TextBox.cs">
<SubType>Component</SubType>
@@ -680,7 +680,7 @@
<Compile Include="UI\Menu\MainFileMenu.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="UI\Menu\ScreenSelectionSystemMenu.cs" />
<Compile Include="UI\Menu\AdvancedWindowMenu.cs" />
<Compile Include="UI\Menu\ToolsMenu.cs">
<SubType>Component</SubType>
</Compile>