Example #1
0
        private void RecurseAddNodes(TreeNode a_node, Sprite a_sp, int a_nNumRecurseLevels)
        {
            //show name, member name, and class name
            string sText = a_sp.GetSceneGraphName();

            TreeNode newNode = new TreeNode(sText);

            newNode.Tag = a_sp.GetHashCode();

            if (a_node == null)
            {
                this.treeView1.Nodes.Add(newNode);
            }
            else
            {
                a_node.Nodes.Add(newNode);                 //treeView1.SelectedNode.Nodes.Add(newNode);
            }
            this._spriteToNode.Add(a_sp, newNode);

            if (a_nNumRecurseLevels > 0)
            {
                a_nNumRecurseLevels--;
            }
            for (int i = 0; i < a_sp.ChildCount; i++)
            {
                Sprite sp = a_sp.GetChildByIndex(i);
                if (a_nNumRecurseLevels == -1 || a_nNumRecurseLevels > 0)
                {
                    RecurseAddNodes(newNode, sp, a_nNumRecurseLevels);
                }
            }
        }
Example #2
0
        public static XmlDocument GenerateXMLDoc(Sprite a_sp, bool a_bOnlyChildren)
        {
            if (a_sp == null)
            {
                a_sp = EH.Instance.Stage.RootSprite;
            }
            XmlDocument doc = new System.Xml.XmlDocument();
            XmlElement  elm = doc.CreateElement("root");

            doc.AppendChild(elm);
            if (a_bOnlyChildren)
            {
                if (a_sp.ChildCount > 0)
                {
                    for (int i = 0; i < a_sp.ChildCount; i++)
                    {
                        RecurseSpritesToXML(elm, a_sp.GetChildByIndex(i));
                    }
                }
            }
            else
            {
                RecurseSpritesToXML(elm, a_sp);
            }
            return(doc);
        }
Example #3
0
 private static void RecurseSpritesToXML(System.Xml.XmlNode a_node, Sprite a_sp)
 {
     System.Xml.XmlNode newNode = Serialization.Serializer.Serialize(a_sp, a_node, null);
     if (a_sp.ChildCount > 0)
     {
         System.Xml.XmlNode childNode = a_node.OwnerDocument.CreateElement("ChildSprites");
         newNode.AppendChild(childNode);
         for (int i = 0; i < a_sp.ChildCount; i++)
         {
             RecurseSpritesToXML(childNode, a_sp.GetChildByIndex(i));
         }
     }
 }
Example #4
0
 public static XmlDocument GenerateXMLDoc(Sprite a_sp, bool a_bOnlyChildren)
 {
     if (a_sp == null)
         a_sp = EH.Instance.Stage.RootSprite;
     XmlDocument doc = new System.Xml.XmlDocument();
     XmlElement elm = doc.CreateElement("root");
     doc.AppendChild(elm);
     if (a_bOnlyChildren)
     {
         if (a_sp.ChildCount > 0)
         {
             for (int i = 0; i < a_sp.ChildCount; i++)
             {
                 RecurseSpritesToXML(elm, a_sp.GetChildByIndex(i));
             }
         }
     }
     else
         RecurseSpritesToXML(elm, a_sp);
     return doc;
 }
Example #5
0
 private static void RecurseSpritesToXML(System.Xml.XmlNode a_node, Sprite a_sp)
 {
     System.Xml.XmlNode newNode = Serialization.Serializer.Serialize(a_sp, a_node, null);
     if (a_sp.ChildCount > 0)
     {
         System.Xml.XmlNode childNode = a_node.OwnerDocument.CreateElement("ChildSprites");
         newNode.AppendChild(childNode);
         for (int i = 0; i < a_sp.ChildCount; i++)
         {
             RecurseSpritesToXML(childNode, a_sp.GetChildByIndex(i));
         }
     }
 }
Example #6
0
        private void RecurseAddNodes(TreeNode a_node, Sprite a_sp, int a_nNumRecurseLevels)
        {
            //show name, member name, and class name
            string sText = a_sp.GetSceneGraphName();

            TreeNode newNode = new TreeNode(sText);
            newNode.Tag = a_sp.GetHashCode();

            if (a_node == null)
                this.treeView1.Nodes.Add(newNode);
            else
                a_node.Nodes.Add(newNode); //treeView1.SelectedNode.Nodes.Add(newNode);

            this._spriteToNode.Add(a_sp, newNode);

            if (a_nNumRecurseLevels > 0)
                a_nNumRecurseLevels--;
            for (int i = 0; i < a_sp.ChildCount; i++)
            {
                Sprite sp = a_sp.GetChildByIndex(i);
                if (a_nNumRecurseLevels == -1 || a_nNumRecurseLevels > 0)
                    RecurseAddNodes(newNode, sp, a_nNumRecurseLevels);
            }
        }