Ejemplo n.º 1
0
        private Compound getCompound(XmlElement xmlcompound)
        {
            // for each <version> element get basic details
            // and what implements it
            Compound compound = new Compound();
            compound.name = xmlcompound.GetAttribute("name");
            compound.istemplate = xmlcompound.GetAttribute("istemplate");
            compound.niflibtype = xmlcompound.GetAttribute("niflibtype");
            compound.nifskopetype = xmlcompound.GetAttribute("nifskopetype");
            if ((xmlcompound.HasChildNodes) && (xmlcompound.FirstChild.NodeType == XmlNodeType.Text))
                compound.description = xmlcompound.FirstChild.Value.Trim();
            else
                compound.description = "";

            //get a nodelist of  elements
            XmlNodeList xmladdlist = xmlcompound.GetElementsByTagName("add");
            if (xmladdlist != null && xmladdlist.Count > 0)
            {
                foreach (XmlElement add in xmladdlist)
                {
                    compound.AddAdd(add.GetAttribute("name"), add.InnerText,
                        add.GetAttribute("ver1"), add.GetAttribute("ver2"),
                        add.GetAttribute("type"), add.GetAttribute("arr1"),
                        add.GetAttribute("arr2"), add.GetAttribute("arr2"),
                        add.GetAttribute("default"), add.GetAttribute("template"),
                        add.GetAttribute("userver"), add.GetAttribute("cond"),
                        add.GetAttribute("arg"));
                }
            }
            return compound;
        }