Esempio n. 1
0
        void mNameBox_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                TreeNode node = mNameBox.Tag as TreeNode;

                if (node != null)
                {
                    if (!nodesDic.ContainsKey(mNameBox.Text))
                    {
                        stringNode realNode = node.Tag as stringNode;

                        if (!IsAdding)
                        {
                            NodeRenamedEventArgs args = new NodeRenamedEventArgs(realNode, node.Text);

                            realNode.Name = mNameBox.Text;
                            node.Name     = mNameBox.Text;
                            node.Text     = mNameBox.Text;

                            OnNodeRenamed(args);
                        }
                        else
                        {
                            AddNewNode(mNameBox.Text, realNode);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Node " + mNameBox.Text + " already exist !");
                    }
                }
                IsAdding         = false;
                mNameBox.Visible = false;
            }
        }
Esempio n. 2
0
 public virtual void OnNodeRenamed(NodeRenamedEventArgs e)
 {
     NodeRenamedEvent(this, e);
 }
Esempio n. 3
0
 void stringNodesTreeView_NodeRenamedEvent(object sender, NodeRenamedEventArgs e)
 {
 }