コード例 #1
0
        private void addChildToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try {
                EditFolderNameForm form = new EditFolderNameForm();
                DialogResult dialog = form.ShowDialog();

                if (dialog == DialogResult.OK) {
                    tvFolderNames.SelectedNode.Nodes.Add(form.Controls["txtNewName"].Text);
                }
            } catch (Exception ex) {
                CommonUtils.ShowError(ex.Message, ex);
            }
        }
コード例 #2
0
        private void addChildToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try {
                EditFolderNameForm form = new EditFolderNameForm();
                DialogResult dialog = form.ShowDialog();
                if (dialog == DialogResult.OK) {

                    string newNodeName = form.Controls["txtNewName"].Text;
                    if (IsValidToAddNode(tvFolderNames.SelectedNode.Nodes, newNodeName)) {
                        TreeNode addedNode = tvFolderNames.SelectedNode.Nodes.Add(newNodeName);
                        addedNode.Tag = GenerateRandomHEX();

                    }
                }
            } catch (Exception ex) {
                FrontendUtils.ShowError(ex.Message, ex);
            }
        }