Example #1
0
                public static ObjectDbField FromXml(XmlNode n)
                {
                    ObjectDbField res = new ObjectDbField();

                    res.id     = int.Parse(n.Attributes["id"].InnerText);
                    res.type   = n.Attributes["type"].InnerText;
                    res.name   = n.Attributes["name"].InnerText;
                    res.values = n.Attributes["values"].InnerText;
                    res.notes  = n.Attributes["notes"].InnerText;
                    return(res);
                }
Example #2
0
            public static ObjectDbEntry FromXml(XmlNodeList nodes)
            {
                ObjectDbEntry res = new ObjectDbEntry();

                foreach (XmlNode n in nodes)
                {
                    switch (n.Name)
                    {
                    case "name":
                        res.name = n.InnerText;
                        break;

                    case "type":
                        res.type = n.InnerText;
                        break;

                    case "model":
                        res.model = n.InnerText;
                        break;

                    case "flags":
                        res.Known    = int.Parse(n.Attributes["known"].InnerText);
                        res.Complete = int.Parse(n.Attributes["complete"].InnerText);
                        break;

                    case "category":
                        res.Category = int.Parse(n.Attributes["id"].InnerText);
                        break;

                    case "notes":
                        res.notes = n.InnerText;
                        break;

                    case "files":
                        res.files = n.InnerText;
                        break;

                    case "field":
                        res.Fields.Add(ObjectDbField.FromXml(n));
                        break;
                    }
                }
                return(res);
            }