mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
few minor refactorings in frmMain
This commit is contained in:
@@ -144,7 +144,7 @@ namespace mRemoteNG.Config.Settings
|
||||
private void SetKioskMode()
|
||||
{
|
||||
if (!mRemoteNG.Settings.Default.MainFormKiosk) return;
|
||||
MainForm._fullscreen.Value = true;
|
||||
MainForm.Fullscreen.Value = true;
|
||||
}
|
||||
|
||||
private static void SetShowSystemTrayIcon()
|
||||
|
||||
@@ -36,9 +36,9 @@ namespace mRemoteNG.Config.Settings
|
||||
|
||||
mRemoteNG.Settings.Default.MainFormState = frmMain.WindowState;
|
||||
|
||||
if (frmMain._fullscreen != null)
|
||||
if (frmMain.Fullscreen != null)
|
||||
{
|
||||
mRemoteNG.Settings.Default.MainFormKiosk = frmMain._fullscreen.Value;
|
||||
mRemoteNG.Settings.Default.MainFormKiosk = frmMain.Fullscreen.Value;
|
||||
}
|
||||
|
||||
mRemoteNG.Settings.Default.FirstStart = false;
|
||||
|
||||
@@ -8,7 +8,6 @@ using mRemoteNG.Connection.Protocol;
|
||||
using mRemoteNG.Container;
|
||||
using mRemoteNG.Themes;
|
||||
using mRemoteNG.Tools;
|
||||
using mRemoteNG.UI.Forms;
|
||||
|
||||
namespace mRemoteNG.UI.Controls
|
||||
{
|
||||
@@ -21,7 +20,18 @@ namespace mRemoteNG.UI.Controls
|
||||
private ContextMenuStrip _mnuQuickConnectProtocol;
|
||||
private QuickConnectComboBox _cmbQuickConnect;
|
||||
private ContextMenuStrip _mnuConnections;
|
||||
private IConnectionInitiator _connectionInitiator = new ConnectionInitiator();
|
||||
|
||||
public IConnectionInitiator ConnectionInitiator
|
||||
{
|
||||
get { return _connectionInitiator; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
return;
|
||||
_connectionInitiator = value;
|
||||
}
|
||||
}
|
||||
|
||||
public QuickConnectToolStrip()
|
||||
{
|
||||
@@ -165,7 +175,7 @@ namespace mRemoteNG.UI.Controls
|
||||
return;
|
||||
}
|
||||
_cmbQuickConnect.Add(connectionInfo);
|
||||
FrmMain.Default._connectionInitiator.OpenConnection(connectionInfo, ConnectionInfo.Force.DoNotJump);
|
||||
ConnectionInitiator.OpenConnection(connectionInfo, ConnectionInfo.Force.DoNotJump);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -215,7 +225,7 @@ namespace mRemoteNG.UI.Controls
|
||||
var tag = ((ToolStripMenuItem)sender).Tag as ConnectionInfo;
|
||||
if (tag != null)
|
||||
{
|
||||
FrmMain.Default._connectionInitiator.OpenConnection(tag);
|
||||
ConnectionInitiator.OpenConnection(tag);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -43,14 +43,15 @@ namespace mRemoteNG.UI.Forms
|
||||
private readonly ScreenSelectionSystemMenu _screenSystemMenu;
|
||||
private ConnectionInfo _selectedConnection;
|
||||
private readonly UnlockerFormFactory _credRepoUnlockerFormFactory = new UnlockerFormFactory();
|
||||
internal FullscreenHandler _fullscreen { get; set; }
|
||||
internal readonly IConnectionInitiator _connectionInitiator = new ConnectionInitiator();
|
||||
private readonly IConnectionInitiator _connectionInitiator = new ConnectionInitiator();
|
||||
|
||||
internal FullscreenHandler Fullscreen { get; set; }
|
||||
|
||||
private FrmMain()
|
||||
{
|
||||
_showFullPathInTitle = Settings.Default.ShowCompleteConsPathInTitle;
|
||||
InitializeComponent();
|
||||
_fullscreen = new FullscreenHandler(this);
|
||||
Fullscreen = new FullscreenHandler(this);
|
||||
pnlDock.Theme = new VS2012LightTheme();
|
||||
_screenSystemMenu = new ScreenSelectionSystemMenu(this);
|
||||
}
|
||||
@@ -170,12 +171,14 @@ namespace mRemoteNG.UI.Forms
|
||||
|
||||
viewMenu1.TsExternalTools = _externalToolsToolStrip;
|
||||
viewMenu1.TsQuickConnect = _quickConnectToolStrip;
|
||||
viewMenu1.FullscreenHandler = _fullscreen;
|
||||
viewMenu1.FullscreenHandler = Fullscreen;
|
||||
viewMenu1.MainForm = this;
|
||||
|
||||
toolsMenu1.MainForm = this;
|
||||
toolsMenu1.CredentialProviderCatalog = Runtime.CredentialProviderCatalog;
|
||||
toolsMenu1.UnlockerFormFactory = _credRepoUnlockerFormFactory;
|
||||
|
||||
_quickConnectToolStrip.ConnectionInitiator = _connectionInitiator;
|
||||
}
|
||||
|
||||
private void ApplyThemes()
|
||||
|
||||
Reference in New Issue
Block a user