From 2b0f670fb7d2de41b1a757e1081cfd391e15e276 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Tue, 26 Jul 2016 12:42:08 -0600 Subject: [PATCH] Extracted method for opening connections from last session --- .../Connections/XmlConnectionsLoader.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs b/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs index 8b42c793a..d346e8dd5 100644 --- a/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs +++ b/mRemoteV1/Config/Connections/XmlConnectionsLoader.cs @@ -80,20 +80,11 @@ namespace mRemoteNG.Config.Connections RootTreeNode.SelectedImageIndex = (int)TreeImageType.Root; } - - // SECTION 3. Populate the TreeView with the DOM nodes. PopulateTreeview(); //open connections from last mremote session - if (mRemoteNG.Settings.Default.OpenConsFromLastSession && !mRemoteNG.Settings.Default.NoReconnect) - { - foreach (ConnectionInfo conI in ConnectionList) - { - if (conI.PleaseConnect) - Runtime.OpenConnection(conI); - } - } + OpenConnectionsFromLastSession(); RootTreeNode.EnsureVisible(); if (!import) @@ -109,6 +100,18 @@ namespace mRemoteNG.Config.Connections } } + private void OpenConnectionsFromLastSession() + { + if (mRemoteNG.Settings.Default.OpenConsFromLastSession && !mRemoteNG.Settings.Default.NoReconnect) + { + foreach (ConnectionInfo conI in ConnectionList) + { + if (conI.PleaseConnect) + Runtime.OpenConnection(conI); + } + } + } + private void PopulateTreeview() { Windows.treeForm.tvConnections.BeginUpdate();