private void button1_Click(object sender, EventArgs e) { NodeForm nf = new NodeForm(owner); if (nf.ShowDialog() == DialogResult.OK) { AddNode(nf.Template); } }
private void button2_Click(object sender, EventArgs e) { if (selected != null && SelectedNode != null) { NodeForm nf = new NodeForm(owner); nf.Template = selected; if (nf.ShowDialog() == DialogResult.OK) { UpdateNode(SelectedNode.Index, nf.Template); } } else { MessageBox.Show("请先选定一个要修改的节点!"); } }