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