Exemple #1
0
        private void 添加节点ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormCaseItem formCaseItem = new FormCaseItem();

            if (formCaseItem.ShowDialog() == DialogResult.OK)
            {
                this.treeView案例.Nodes.Add(string.Format("{0}【{1}】", formCaseItem.CaseName, formCaseItem.Character));

                this.treeView案例.Update();
            }
        }
Exemple #2
0
        private void 后面添加节点toolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormCaseItem formCaseItem = new FormCaseItem();

            if (formCaseItem.ShowDialog() == DialogResult.OK)
            {
                if (this.treeView案例.SelectedNode.Parent == null)
                {
                    this.treeView案例.Nodes.Insert(this.treeView案例.SelectedNode.Index + 1, string.Format("{0}【{1}】", formCaseItem.CaseName, formCaseItem.Character));
                }
                else
                {
                    this.treeView案例.SelectedNode.Parent.Nodes.Insert(this.treeView案例.SelectedNode.Index + 1, string.Format("{0}【{1}】", formCaseItem.CaseName, formCaseItem.Character));
                }
            }
        }
Exemple #3
0
        private void 修改节点ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.treeView案例.SelectedNode == null)
            {
                return;
            }

            int    last左括号   = this.treeView案例.SelectedNode.Text.LastIndexOf('【');
            string caseName  = this.treeView案例.SelectedNode.Text.Substring(0, last左括号);
            string character = this.treeView案例.SelectedNode.Text.Substring(last左括号 + 1, this.treeView案例.SelectedNode.Text.Length - last左括号 - 2);

            FormCaseItem formCaseItem = new FormCaseItem(caseName, character);

            if (formCaseItem.ShowDialog() == DialogResult.OK)
            {
                this.treeView案例.SelectedNode.Text = string.Format("{0}【{1}】", formCaseItem.CaseName, formCaseItem.Character);

                this.treeView案例.Update();
            }
        }