private void 编辑解析ToolStripMenuItem_Click(object sender, EventArgs e) { // 编辑鞋机 TreeNode node = treeView1.SelectedNode; if (node.Tag is RegularNode regularNode) { using (FormRegularNode formNode = new FormRegularNode(regularNode)) { if (formNode.ShowDialog( ) == DialogResult.OK) { formNode.RegularNode.Name = GetUniqueName(node, formNode.RegularNode.Name); node.Text = formNode.RegularNode.Name; node.Tag = formNode.RegularNode; isNodeSettingsModify = true; UpdateTreeData( ); } } } }
private bool isNodeSettingsModify = false; // 指示系统的节点是否已经被编辑过 #endregion #region Add RegularNode private void 新增RequestToolStripMenuItem_Click(object sender, EventArgs e) { // 新增解析规则 TreeNode node = treeView1.SelectedNode; using (FormRegularNode formNode = new FormRegularNode( )) { if (formNode.ShowDialog( ) == DialogResult.OK) { formNode.RegularNode.Name = GetUniqueName(node, formNode.RegularNode.Name); TreeNode nodeNew = new TreeNode(formNode.RegularNode.Name); nodeNew.ImageKey = "Operator_660"; nodeNew.SelectedImageKey = "Operator_660"; nodeNew.Tag = formNode.RegularNode; node.Nodes.Add(nodeNew); node.Expand( ); isNodeSettingsModify = true; UpdateTreeData( ); } } }