From 789e467573d0c4c464d5f6581a25778ccd990fd5 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Fri, 3 Feb 2017 10:43:42 -0700 Subject: [PATCH] remove references to Windows.TreePanel --- mRemoteV1/App/Windows.cs | 3 +-- mRemoteV1/Config/Settings/LayoutSettingsLoader.cs | 9 ++------- mRemoteV1/UI/Forms/frmMain.cs | 12 ++++++------ mRemoteV1/UI/Window/ConnectionTreeWindow.cs | 4 ++++ 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/mRemoteV1/App/Windows.cs b/mRemoteV1/App/Windows.cs index 8fac294d..9d0d6edc 100644 --- a/mRemoteV1/App/Windows.cs +++ b/mRemoteV1/App/Windows.cs @@ -25,8 +25,7 @@ namespace mRemoteNG.App private static ComponentsCheckWindow _componentscheckForm; private static DockContent _componentscheckPanel = new DockContent(); - public static ConnectionTreeWindow TreeForm { get; set; } - public static DockContent TreePanel { get; set; } = new DockContent(); + public static ConnectionTreeWindow TreeForm { get; set; } = new ConnectionTreeWindow(); public static ConfigWindow ConfigForm { get; set; } = new ConfigWindow(); public static ErrorAndInfoWindow ErrorsForm { get; set; } = new ErrorAndInfoWindow(); public static ScreenshotManagerWindow ScreenshotForm { get; set; } diff --git a/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs b/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs index 77974e04..d3f70b8c 100644 --- a/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs +++ b/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs @@ -21,8 +21,6 @@ namespace mRemoteNG.Config.Settings { try { - Windows.TreePanel = null; - while (_mainForm.pnlDock.Contents.Count > 0) { var dc = (DockContent)_mainForm.pnlDock.Contents[0]; @@ -67,7 +65,7 @@ namespace mRemoteNG.Config.Settings return Windows.ConfigForm; if (persistString == typeof(ConnectionTreeWindow).ToString()) - return Windows.TreePanel; + return Windows.TreeForm; if (persistString == typeof(ErrorAndInfoWindow).ToString()) return Windows.ErrorsForm; @@ -86,10 +84,7 @@ namespace mRemoteNG.Config.Settings private void CreatePanels() { Windows.ConfigForm = new ConfigWindow(); - - Windows.TreeForm = new ConnectionTreeWindow(Windows.TreePanel); - Windows.TreePanel = Windows.TreeForm; - + Windows.TreeForm = new ConnectionTreeWindow(); Windows.ErrorsForm = new ErrorAndInfoWindow(); Windows.ScreenshotForm = new ScreenshotManagerWindow(Windows.ScreenshotPanel); diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index e0d271bc..c2ef6045 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -227,7 +227,7 @@ namespace mRemoteNG.UI.Forms if (upgradeMap != null) ApplyCredentialMapping(upgradeMap); - Windows.TreePanel.Focus(); + Windows.TreeForm.Focus(); PuttySessionsManager.Instance.StartWatcher(); if (Settings.Default.StartupComponentsCheck) @@ -750,12 +750,12 @@ namespace mRemoteNG.UI.Forms { if (mMenViewConnections.Checked == false) { - Windows.TreePanel.Show(pnlDock); + Windows.TreeForm.Show(pnlDock); mMenViewConnections.Checked = true; } else { - Windows.TreePanel.Hide(); + Windows.TreeForm.Hide(); mMenViewConnections.Checked = false; } } @@ -804,7 +804,7 @@ namespace mRemoteNG.UI.Forms private void mMenViewJumpToConnectionsConfig_Click(object sender, EventArgs e) { - if (pnlDock.ActiveContent == Windows.TreePanel) + if (pnlDock.ActiveContent == Windows.TreeForm) { Windows.ConfigForm.Activate(); } @@ -1307,9 +1307,9 @@ namespace mRemoteNG.UI.Forms Default.pnlDock.DockTopPortion = Default.pnlDock.Height * 0.25; Default.pnlDock.DockBottomPortion = Default.pnlDock.Height * 0.25; - Windows.TreePanel.Show(Default.pnlDock, DockState.DockLeft); + Windows.TreeForm.Show(Default.pnlDock, DockState.DockLeft); Windows.ConfigForm.Show(Default.pnlDock); - Windows.ConfigForm.DockTo(Windows.TreePanel.Pane, DockStyle.Bottom, -1); + Windows.ConfigForm.DockTo(Windows.TreeForm.Pane, DockStyle.Bottom, -1); Windows.ErrorsForm.Show(Default.pnlDock, DockState.Document); Windows.ErrorsForm.Hide(); diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index d6716a41..260839fe 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -25,6 +25,10 @@ namespace mRemoteNG.UI.Window { get { return olvConnections; } set { olvConnections = value; } + } + + public ConnectionTreeWindow() : this(new DockContent()) + { } public ConnectionTreeWindow(DockContent panel)