コード例 #1
0
        //***************************************XML-BUILDERS***********************************************
        private void BuildNode(XmlElement pParent, GVSTreeNode pNode)
        {
            gvsTreeNodes.Add(pNode);
            var interfaces = pNode.GetType().GetInterfaces();

            foreach (var theInterface in interfaces)
            {
                if (theInterface.FullName == typeof(GVSBinaryTreeNode).FullName)
                {
                    BuildBinaryNode(pParent, (GVSBinaryTreeNode)pNode);
                    var tmpNode = ((GVSBinaryTreeNode)pNode).GetGvsLeftChild();
                    if (tmpNode != null)
                    {
                        BuildNode(pParent, tmpNode);
                    }
                    tmpNode = ((GVSBinaryTreeNode)pNode).GetGvsRigthChild();
                    if (tmpNode != null)
                    {
                        BuildNode(pParent, tmpNode);
                    }
                    break;
                }
                else if (theInterface.FullName == typeof(GVSDefaultTreeNode).FullName)
                {
                    //buildDefaultNode(pParent,(GVSDefaultTreeNode)pNode);
                    //GVSDefaultTreeNode[] childs=((GVSDefaultTreeNode)(pNode)).getChildNodes();
                    //if(childs!=null){
                    //for(int size=0;size<childs.Length;size++){
                    //buildNode(pParent,childs[size]);
                    //}
                    //}
                }
            }
        }
コード例 #2
0
 /// <summary>
 ///  Set the rootnode for the tree
 /// </summary>
 /// <param name="pGVSRootTreeNode"></param>
 public void SetRoot(GVSTreeNode pGVSRootTreeNode)
 {
     this.gvsTreeRoot = pGVSRootTreeNode;
 }