Extracted method for opening connections from last session

This commit is contained in:
David Sparer
2016-07-26 12:42:08 -06:00
parent b5c431dca8
commit 2b0f670fb7

View File

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