Example #1
0
        public void Add(ConnectionNode node)
        {
            int index = Find(node.Name);

            if (index >= 0)
            {
                Nodes.Insert(index, node.Clone());
                Nodes.RemoveAt(index + 1);
            }
            else
            {
                Nodes.Add(node.Clone());
            }
        }
Example #2
0
        private void NewNode(ConnectionNode nodeFrom)
        {
            NodeConfig nc = new NodeConfig();

            if (null == nodeFrom)
            {
                ConnectionNodeBuilder.Defaults(nc.Node);
            }
            else
            {
                nc.Node           = nodeFrom.Clone();
                nc.Node.IsBuiltIn = false;
                nc.Node.Name      = "New Node - " + Guid.NewGuid().ToString().Substring(0, 5);
            }

            if (nc.ShowDialog() == DialogResult.OK)
            {
                ConnectionNodes.Instance().Add(nc.Node);
                BuildView();
                if (comboBox1.Items.Count > 0)
                {
                    comboBox1.SelectedIndex = comboBox1.Items.Count - 1;
                }
                UpdateView();
            }
        }