private void AddNode(ConnectionInfo newNode)
        {
            if (SelectedNode?.GetTreeNodeType() == TreeNodeType.PuttyRoot || SelectedNode?.GetTreeNodeType() == TreeNodeType.PuttySession)
            {
                return;
            }

            // the new node will survive filtering if filtering is active
            _connectionTreeSearchTextFilter.SpecialInclusionList.Add(newNode);

            // use root node if no node is selected
            ConnectionInfo parentNode = SelectedNode ?? GetRootConnectionNode();

            DefaultConnectionInfo.Instance.SaveTo(newNode);
            DefaultConnectionInheritance.Instance.SaveTo(newNode.Inheritance);
            var selectedContainer = parentNode as ContainerInfo;
            var parent            = selectedContainer ?? parentNode?.Parent;

            newNode.SetParent(parent);
            Expand(parent);
            SelectObject(newNode, true);
            EnsureModelVisible(newNode);
            _allowEdit = true;
            SelectedItem.BeginEdit();
        }
 public void RenameSelectedNode()
 {
     if (SelectedItem != null)
     {
         _allowEdit = true;
         SelectedItem.BeginEdit();
     }
 }
예제 #3
0
 public void RenameSelectedNode()
 {
     if (SelectedItem == null)
     {
         return;
     }
     _allowEdit = true;
     SelectedItem.BeginEdit();
 }
예제 #4
0
 public void RenameSelectedNode()
 {
     _allowEdit = true;
     SelectedItem.BeginEdit();
     Runtime.SaveConnectionsAsync();
 }