Merge pull request #534 from mRemoteNG/530_fix_tree_node_entry_creation_on_exttool_run

530 fix tree node entry creation on exttool run
This commit is contained in:
David Sparer
2017-05-02 10:00:30 -06:00
committed by GitHub
7 changed files with 25 additions and 8 deletions

View File

@@ -1,4 +1,11 @@
1.75.7005 (2017-04-27)
1.75.7006 (2017-xx-xx):
Fixes:
------
#530: Fixed issue where using External Tool on existing connection causes creation of 'New Connection' entry
1.75.7005 (2017-04-27):
Fixes:
------

View File

@@ -48,6 +48,14 @@ namespace mRemoteNGTests.Connection
Assert.That(secondConnection.Domain, Is.EqualTo(_connectionInfo.Domain));
}
[Test]
public void CloneDoesNotSetParentOfNewConnectionInfo()
{
_connectionInfo.SetParent(new ContainerInfo());
var clonedConnection = _connectionInfo.Clone();
Assert.That(clonedConnection.Parent, Is.Null);
}
[Test]
public void CopyFromCopiesProperties()
{

View File

@@ -263,6 +263,14 @@ namespace mRemoteNGTests.Container
Assert.That(clone.ConstantID, Is.Not.EqualTo(_containerInfo.ConstantID));
}
[Test]
public void ClonedContainerDoesNotHaveParentSet()
{
_containerInfo.SetParent(new ContainerInfo());
var clone = _containerInfo.Clone();
Assert.That(clone.Parent, Is.Null);
}
[Test]
public void ClonedContainerContainsClonedChildren()
{

View File

@@ -78,7 +78,6 @@ namespace mRemoteNG.Connection
var newConnectionInfo = new ConnectionInfo();
newConnectionInfo.CopyFrom(this);
newConnectionInfo.ConstantID = MiscTools.CreateConstantID();
newConnectionInfo.SetParent(Parent);
newConnectionInfo.Inheritance = Inheritance.Clone();
return newConnectionInfo;
}

View File

@@ -179,7 +179,6 @@ namespace mRemoteNG.Container
var newContainer = new ContainerInfo();
newContainer.CopyFrom(this);
newContainer.ConstantID = MiscTools.CreateConstantID();
newContainer.SetParent(Parent);
newContainer.OpenConnections = new ProtocolList();
newContainer.Inheritance = Inheritance.Clone();
foreach (var child in Children.ToArray())

View File

@@ -63,11 +63,6 @@ namespace mRemoteNG.Tree
connectionInfo?.RemoveParent();
}
public void CloneNode(ConnectionInfo connectionInfo)
{
connectionInfo.Clone();
}
public event NotifyCollectionChangedEventHandler CollectionChanged;
private void RaiseCollectionChangedEvent(object sender, NotifyCollectionChangedEventArgs args)
{

View File

@@ -215,6 +215,7 @@ namespace mRemoteNG.UI.Controls
public void DuplicateSelectedNode()
{
var newNode = SelectedNode.Clone();
SelectedNode.Parent.AddChildBelow(newNode, SelectedNode);
newNode.Parent.SetChildBelow(newNode, SelectedNode);
Runtime.SaveConnectionsAsync();
}