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(); } }
private void EditNode() { NodeConfig nc = new NodeConfig(); int selectedNode = SelectedNode; nc.Node = ConnectionNodes.Instance().Nodes[selectedNode]; if (nc.ShowDialog() == DialogResult.OK) { BuildView(); if (comboBox1.Items.Count > 0) { comboBox1.SelectedIndex = selectedNode; } UpdateView(); } }