示例#1
0
 private void menuEdit_Click(object sender, EventArgs e)
 {
     if (this.treeView1.SelectedNode != null)
     {
         XmlCommand command = this.treeView1.SelectedNode.GetTagValue();
         if (command != null)
         {
             EditCommandDialogFix dialog = new EditCommandDialogFix();
             dialog.method_5(command);
             if (dialog.ShowDialog() == DialogResult.OK)
             {
                 command = dialog.method_4();
                 this.treeView1.SelectedNode.SetTagValue(command);
                 this.treeView1.SelectedNode.Text = command.CommandName;
                 this.bool_0 = true;
                 this.treeView1_AfterSelect(null, null);
             }
         }
     }
 }
示例#2
0
 private void menuAdd_Click(object sender, EventArgs e)
 {
     TreeNode selectedNode = this.treeView1.SelectedNode;
     if (selectedNode != null)
     {
         TreeNode node3 = selectedNode.IsTagEmpty() ? selectedNode : selectedNode.Parent;
         EditCommandDialogFix dialog = new EditCommandDialogFix();
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             XmlCommand command = dialog.method_4();
             TreeNode node2 = new TreeNode(command.CommandName, int_2, int_3);
             node2.SetTagValue(command);
             node3.Nodes.Add(node2);
             this.treeView1.SelectedNode = node2;
             node2.EnsureVisible();
             this.method_1();
         }
     }
 }