TreeView Remove Selected Node


Node Information
Removes selected node from the specified TreeView.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Remove IN RUN MULTIPLE FALSE FALSE
TreeView IN TreeView ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.TreeView
{
    [IsNode("Remove Selected Node")]
    public class TreeViewRemoveSelected : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Remove");
        Port control = new Port(PortType.IN, typeof(Korduene.Designer.Standard.TreeView), AcceptsLinks.ONE, "TreeView");
        public TreeViewRemoveSelected()
        {
            this.Name = "TreeView Remove Selected Node";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(control);
            Information = "Removes selected node from the specified TreeView.";
        }
        public override string Code()
        {
            string c = GetValue(control);
            return "{if (" + c + ".SelectedNode !=null){" + c + ".Nodes.Remove(" + c + ".SelectedNode);}}";
        }
    }
}