mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
some more cleanup
This commit is contained in:
@@ -14,6 +14,8 @@ namespace mRemoteNG.Connection
|
||||
{
|
||||
public class ConnectionInitiator : IConnectionInitiator
|
||||
{
|
||||
private FrmMain _frmMain = FrmMain.Default;
|
||||
|
||||
public void OpenConnection(ContainerInfo containerInfo, ConnectionInfo.Force force = ConnectionInfo.Force.None)
|
||||
{
|
||||
OpenConnection(containerInfo, force, null);
|
||||
@@ -50,7 +52,7 @@ namespace mRemoteNG.Connection
|
||||
var connectionWindow = (ConnectionWindow)interfaceControl.FindForm();
|
||||
connectionWindow?.Focus();
|
||||
var findForm = (ConnectionWindow)interfaceControl.FindForm();
|
||||
findForm?.Show(FrmMain.Default.pnlDock);
|
||||
findForm?.Show(_frmMain.pnlDock);
|
||||
var tabPage = (TabPage)interfaceControl.Parent;
|
||||
tabPage.Selected = true;
|
||||
return true;
|
||||
@@ -114,7 +116,7 @@ namespace mRemoteNG.Connection
|
||||
}
|
||||
|
||||
connectionInfo.OpenConnections.Add(newProtocol);
|
||||
FrmMain.Default.SelectedConnection = connectionInfo;
|
||||
_frmMain.SelectedConnection = connectionInfo;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -168,14 +170,14 @@ namespace mRemoteNG.Connection
|
||||
return connectionPanel;
|
||||
}
|
||||
|
||||
private static Form SetConnectionForm(Form conForm, string connectionPanel)
|
||||
private Form SetConnectionForm(Form conForm, string connectionPanel)
|
||||
{
|
||||
var connectionForm = conForm ?? Runtime.WindowList.FromString(connectionPanel);
|
||||
|
||||
if (connectionForm == null)
|
||||
connectionForm = Runtime.AddPanel(connectionPanel);
|
||||
else
|
||||
((ConnectionWindow)connectionForm).Show(FrmMain.Default.pnlDock);
|
||||
((ConnectionWindow)connectionForm).Show(_frmMain.pnlDock);
|
||||
|
||||
connectionForm.Focus();
|
||||
return connectionForm;
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
{
|
||||
public partial class ConnectionsPage
|
||||
{
|
||||
private FrmMain _frmMain = FrmMain.Default;
|
||||
|
||||
public ConnectionsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -82,12 +84,12 @@ namespace mRemoteNG.UI.Forms.OptionsPages
|
||||
Settings.Default.AutoSaveEveryMinutes = (int) numAutoSave.Value;
|
||||
if (Settings.Default.AutoSaveEveryMinutes > 0)
|
||||
{
|
||||
FrmMain.Default.tmrAutoSave.Interval = Settings.Default.AutoSaveEveryMinutes*60000;
|
||||
FrmMain.Default.tmrAutoSave.Enabled = true;
|
||||
_frmMain.tmrAutoSave.Interval = Settings.Default.AutoSaveEveryMinutes*60000;
|
||||
_frmMain.tmrAutoSave.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
FrmMain.Default.tmrAutoSave.Enabled = false;
|
||||
_frmMain.tmrAutoSave.Enabled = false;
|
||||
}
|
||||
|
||||
if (radCloseWarnAll.Checked)
|
||||
|
||||
Reference in New Issue
Block a user