Ejemplo n.º 1
0
        public void Parse(XmlNode node)
        {
            if (node.Name != "Techne")
                return;

            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "version")
                    Version = a.Value;
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "author")
                    Author = child.InnerText;
                else if (name == "datecreated")
                    DateCreated = child.InnerText;
                else if (name == "description")
                    Description = child.InnerText;
                else if (name == "models")
                {
                    foreach (XmlNode modelChild in child.ChildNodes)
                    {
                        if (modelChild.Name.ToLower() == "model")
                        {
                            var model = new TCNModel();
                            model.Parse(modelChild);
                            Models.Add(model);
                        }
                    }
                }
                else if (name == "name")
                    Name = child.InnerText;
                else if (name == "previewimage")
                    PreviewImage = child.InnerText;
                else if (name == "projectname")
                    ProjectName = child.InnerText;
                else if (name == "projecttype")
                    ProjectType = child.InnerText;
            }
        }
Ejemplo n.º 2
0
        public void Parse(XmlNode node)
        {
            if (node.Name != "Techne")
            {
                return;
            }

            foreach (XmlAttribute a in node.Attributes)
            {
                if (a.Name.ToLower() == "version")
                {
                    Version = a.Value;
                }
            }

            foreach (XmlNode child in node.ChildNodes)
            {
                string name = child.Name.ToLower();

                if (name == "author")
                {
                    Author = child.InnerText;
                }
                else if (name == "datecreated")
                {
                    DateCreated = child.InnerText;
                }
                else if (name == "description")
                {
                    Description = child.InnerText;
                }
                else if (name == "models")
                {
                    foreach (XmlNode modelChild in child.ChildNodes)
                    {
                        if (modelChild.Name.ToLower() == "model")
                        {
                            var model = new TCNModel();
                            model.Parse(modelChild);
                            Models.Add(model);
                        }
                    }
                }
                else if (name == "name")
                {
                    Name = child.InnerText;
                }
                else if (name == "previewimage")
                {
                    PreviewImage = child.InnerText;
                }
                else if (name == "projectname")
                {
                    ProjectName = child.InnerText;
                }
                else if (name == "projecttype")
                {
                    ProjectType = child.InnerText;
                }
            }
        }