Exemplo n.º 1
0
        private void addScriptCommand(TreeNode parent, List <ScriptCommand> commandList)
        {
            TreeNode curParent = parent;

            foreach (ScriptCommand cmd in commandList)
            {
                TreeNode tnCommand = new TreeNode(CScenario.getNodeText(cmd));
                tnCommand.Tag = cmd;
                if (((ScriptCommand)tnCommand.Tag).id == 1)
                {
                    tnCommand.ForeColor = Color.Red;
                }

                curParent.Nodes.Add(tnCommand);

                if (cmd.isExtValueAvailable())
                {
                    curParent = tnCommand;
                }
                else if (cmd.Id == (int)CommandId.CMD_ACTION_END)
                {
                    curParent = curParent.Parent;
                }
            }
        }
Exemplo n.º 2
0
 private void 修改ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (treeViewRoot.SelectedNode.Level > 2)
     {
         ScriptCommand cmd = (ScriptCommand)treeViewRoot.SelectedNode.Tag;
         if (cmd.Keys.Length > 0)
         {
             CCodeEditDlg dlg = new CCodeEditDlg(cmd);
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 treeViewRoot.SelectedNode.Text = CScenario.getNodeText(cmd);
             }
         }
     }
 }
Exemplo n.º 3
0
 private void treeViewRoot_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (treeViewRoot.SelectedNode.Level > 2)
     {
         //treeViewRoot.l
         ScriptCommand cmd = (ScriptCommand)treeViewRoot.SelectedNode.Tag;
         if (cmd.Keys.Length > 0)
         {
             CCodeEditDlg dlg = new CCodeEditDlg(cmd);
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 treeViewRoot.SelectedNode.Text = CScenario.getNodeText(cmd);
             }
         }
     }
 }