diff --git a/mRemoteV1/Connection/ConnectionInitiator.cs b/mRemoteV1/Connection/ConnectionInitiator.cs index a1587dbc7..a975983f6 100644 --- a/mRemoteV1/Connection/ConnectionInitiator.cs +++ b/mRemoteV1/Connection/ConnectionInitiator.cs @@ -15,38 +15,6 @@ namespace mRemoteNG.Connection { public static class ConnectionInitiator { - //TODO Fix for TreeListView - public static void OpenConnection(ConnectionInfo.Force Force) - { - try - { - if (Windows.treeForm.tvConnections.SelectedNode.Tag == null) - return; - - if (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.PuttySession) - { - OpenConnection((ConnectionInfo)Windows.treeForm.tvConnections.SelectedNode.Tag, Force); - } - else if (ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.Container) - { - foreach (TreeNode tNode in ConnectionTree.SelectedNode.Nodes) - { - if (ConnectionTreeNode.GetNodeType(tNode) == TreeNodeType.Connection | ConnectionTreeNode.GetNodeType(ConnectionTree.SelectedNode) == TreeNodeType.PuttySession) - { - if (tNode.Tag != null) - { - OpenConnection((ConnectionInfo)tNode.Tag, Force); - } - } - } - } - } - catch (Exception ex) - { - Runtime.MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strConnectionOpenFailed + Environment.NewLine + ex.Message); - } - } - //TODO Fix for TreeListView public static void OpenConnection(ConnectionInfo ConnectionInfo) { diff --git a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs index 1535240dd..e12d43606 100644 --- a/mRemoteV1/UI/Window/ConnectionTreeWindow.cs +++ b/mRemoteV1/UI/Window/ConnectionTreeWindow.cs @@ -455,32 +455,32 @@ namespace mRemoteNG.UI.Window private void cMenTreeConnect_Click(object sender, EventArgs e) { - ConnectionInitiator.OpenConnection(ConnectionInfo.Force.DoNotJump); + ConnectionInitiator.OpenConnection(SelectedNode, ConnectionInfo.Force.DoNotJump); } private void cMenTreeConnectWithOptionsConnectToConsoleSession_Click(object sender, EventArgs e) { - ConnectionInitiator.OpenConnection(ConnectionInfo.Force.UseConsoleSession | ConnectionInfo.Force.DoNotJump); + ConnectionInitiator.OpenConnection(SelectedNode, ConnectionInfo.Force.UseConsoleSession | ConnectionInfo.Force.DoNotJump); } private void cMenTreeConnectWithOptionsNoCredentials_Click(object sender, EventArgs e) { - ConnectionInitiator.OpenConnection(ConnectionInfo.Force.NoCredentials); + ConnectionInitiator.OpenConnection(SelectedNode, ConnectionInfo.Force.NoCredentials); } private void cMenTreeConnectWithOptionsDontConnectToConsoleSession_Click(object sender, EventArgs e) { - ConnectionInitiator.OpenConnection(ConnectionInfo.Force.DontUseConsoleSession | ConnectionInfo.Force.DoNotJump); + ConnectionInitiator.OpenConnection(SelectedNode, ConnectionInfo.Force.DontUseConsoleSession | ConnectionInfo.Force.DoNotJump); } private void cMenTreeConnectWithOptionsConnectInFullscreen_Click(object sender, EventArgs e) { - ConnectionInitiator.OpenConnection(ConnectionInfo.Force.Fullscreen | ConnectionInfo.Force.DoNotJump); + ConnectionInitiator.OpenConnection(SelectedNode, ConnectionInfo.Force.Fullscreen | ConnectionInfo.Force.DoNotJump); } private void cMenTreeConnectWithOptionsChoosePanelBeforeConnecting_Click(object sender, EventArgs e) { - ConnectionInitiator.OpenConnection(ConnectionInfo.Force.OverridePanel | ConnectionInfo.Force.DoNotJump); + ConnectionInitiator.OpenConnection(SelectedNode, ConnectionInfo.Force.OverridePanel | ConnectionInfo.Force.DoNotJump); } private void cMenTreeDisconnect_Click(object sender, EventArgs e)