private void AddNodeNotify(object sender, NodeAddEventArgs e)
 {
     if (null != AddNode)
     {
         AddNode(sender, e);
     }
 }
        private void InsertAtSelectedNode(object sender, EventArgs e)
        {
            try
            {
                if (null != this.CurSelectedNode)
                {
                    int      CurIndex = this.CurSelectedNode.Index;
                    ViewNode node     = GetCacheNode();
                    if (null != node)
                    {
                        bool InsertFlag = true;
                        if ((MyConst.View.KnxPageType == this.CurSelectedNode.Name) || (MyConst.Controls.KnxGroupBoxType == this.CurSelectedNode.Name))
                        {
                            if (!EntityHelper.IsControlNode(this.CurSelectedNode.Parent.Name))
                            {
                                InsertFlag = false;
                            }
                        }
                        else if (EntityHelper.IsControlNodeAndNotChildNode(this.CurSelectedNode.Parent.Name))
                        {
                            InsertFlag = false;
                        }

                        if (InsertFlag)
                        {
                            this.cqpo.ExecuteCommand(new TreeNodeAdd(this.tvPage, this.CurSelectedNode.Parent, node, CurIndex));

                            NodeAddEventArgs arg = new NodeAddEventArgs();
                            arg.mPageNode   = this.CurPageNode;
                            arg.mParentNode = this.CurSelectedNode.Parent as ViewNode;
                            arg.mNode       = node;
                            AddNodeNotify(node, arg);

                            TreeViewChangedEventNotify(node, EventArgs.Empty);
                        }
                        else
                        {
                            MessageBox.Show(string.Format(UIResMang.GetString("Message47"), node.Name,
                                                          this.CurSelectedNode.Parent.Name), UIResMang.GetString("Message6"),
                                            MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }

                    this.cacheNode = null;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        private void AddNodeValueDisplay(ViewNode pNode)
        {
            if (null != pNode)
            {
                if ((MyConst.View.KnxPageType == pNode.Name) || (MyConst.Controls.KnxGroupBoxType == pNode.Name))
                {
                    ValueDisplayNode node = new ValueDisplayNode();
                    //pNode.Nodes.Add(node);
                    this.cqpo.ExecuteCommand(new TreeNodeAdd(this.tvPage, pNode, node, -1));

                    NodeAddEventArgs arg = new NodeAddEventArgs();
                    arg.mPageNode   = this.CurPageNode;
                    arg.mParentNode = pNode;
                    arg.mNode       = node;
                    AddNodeNotify(node, arg);
                }
            }
        }