/*	private void buildDefaultNode(XmlElement pParent, GVSDefaultTreeNode pNode){
         *              XmlElement defaultNode = document.CreateElement(DEFAULTNODE);
         *              pParent.AppendChild(defaultNode);
         *              defaultNode.SetAttribute(ATTRIBUTEID,pNode.GetHashCode().ToString());
         *              GVSNodeTyp nodeTyp =pNode.getNodeTyp();
         *
         *              XmlElement label = document.CreateElement(LABEL);
         *              defaultNode.AppendChild(label);
         *              string theLabel=pNode.getNodeLabel();
         *
         *              XmlElement lineColor = document.CreateElement(LINECOLOR);
         *              defaultNode.AppendChild(lineColor);
         *
         *              XmlElement lineStyle = document.CreateElement(LINESTYLE);
         *              defaultNode.AppendChild(lineStyle);
         *
         *              XmlElement lineThick = document.CreateElement(LINETHICKNESS);
         *              defaultNode.AppendChild(lineThick);
         *
         *              XmlElement fillColor = document.CreateElement(FILLCOLOR);
         *              defaultNode.AppendChild(fillColor);
         *
         *              if(theLabel==null){
         *                      theLabel="";
         *              }
         *              label.AppendChild(document.CreateTextNode(theLabel));
         *
         *
         *              if(nodeTyp!=null){
         *
         *                      lineColor.AppendChild(document.CreateTextNode(nodeTyp.getLineColor().ToString()));
         *                      lineStyle.AppendChild(document.CreateTextNode(nodeTyp.getLineStyle().ToString()));
         *                      lineThick.AppendChild(document.CreateTextNode(nodeTyp.getLineThickness().ToString()));
         *                      fillColor.AppendChild(document.CreateTextNode(nodeTyp.getFillColor().ToString()));
         *              }
         *              else{
         *                      lineColor.AppendChild(document.CreateTextNode(STANDARD));
         *                      lineStyle.AppendChild(document.CreateTextNode(STANDARD));
         *                      lineThick.AppendChild(document.CreateTextNode(STANDARD));
         *                      fillColor.AppendChild(document.CreateTextNode(STANDARD));
         *              }
         *              GVSDefaultTreeNode[] childs=pNode.getChildNodes();
         *                      if(childs!=null){
         *                              for(int size=0;size<childs.Length;size++){
         *                                      XmlElement child = document.CreateElement(CHILDID);
         *                                      defaultNode.AppendChild(child);
         *                                      child.AppendChild(document.CreateTextNode(childs[size].GetHashCode().ToString()));
         *                      }
         *              }
         *      }			*/

        private void BuildBinaryNode(XmlElement pParent, GVSBinaryTreeNode pNode)
        {
            var binaryNode = document.CreateElement(DEFAULTNODE);

            pParent.AppendChild(binaryNode);
            binaryNode.SetAttribute(ATTRIBUTEID, pNode.GetHashCode().ToString());
            var nodeStyle = pNode.GetStyle() ?? new GVSStyle();

            var label = document.CreateElement(LABEL);

            binaryNode.AppendChild(label);
            var theLabel = pNode.GetGvsNodeLabel() ?? "";

            label.AppendChild(document.CreateTextNode(theLabel));

            var lineColor = document.CreateElement(LINECOLOR);

            binaryNode.AppendChild(lineColor);

            var lineStyle = document.CreateElement(LINESTYLE);

            binaryNode.AppendChild(lineStyle);

            var lineThick = document.CreateElement(LINETHICKNESS);

            binaryNode.AppendChild(lineThick);

            var fillColor = document.CreateElement(FILLCOLOR);

            binaryNode.AppendChild(fillColor);


            lineColor.AppendChild(document.CreateTextNode(nodeStyle.GetLineColor().ToString()));
            lineStyle.AppendChild(document.CreateTextNode(nodeStyle.GetLineStyle().ToString()));
            lineThick.AppendChild(document.CreateTextNode(nodeStyle.GetLineThickness().ToString()));
            fillColor.AppendChild(document.CreateTextNode(nodeStyle.GetFillColor().ToString()));


            var leftNode  = pNode.GetGvsLeftChild();
            var rigthNode = pNode.GetGvsRigthChild();

            if (leftNode != null)
            {
                var leftChild = document.CreateElement(LEFTCHILD);
                binaryNode.AppendChild(leftChild);
                leftChild.AppendChild(document.CreateTextNode(leftNode.GetHashCode().ToString()));
            }
            if (rigthNode != null)
            {
                var rigthChild = document.CreateElement(RIGTHCHILD);
                binaryNode.AppendChild(rigthChild);
                rigthChild.AppendChild(document.CreateTextNode(rigthNode.GetHashCode().ToString()));
            }
        }
예제 #2
0
 /// <summary>
 ///	 Remove a BinaryNode
 /// </summary>
 /// <param name="pGVSNode"></param>
 public void Remove(GVSBinaryTreeNode pGVSNode)
 {
     this.gvsTreeNodes.Remove(pGVSNode);
 }
예제 #3
0
 /// <summary>
 ///	 Add a Binarynode
 /// </summary>
 /// <param name="pGVSNode"></param>
 public void Add(GVSBinaryTreeNode pGVSNode)
 {
     this.gvsTreeNodes.Add(pGVSNode);
 }