Deserialize() public method

public Deserialize ( System.Xml.Linq.XElement element ) : void
element System.Xml.Linq.XElement
return void
Example #1
0
 public virtual void Deserialize(XElement element)
 {
     if (string.Compare(element.Name.ToString(), "devicemanufacture") == 0)
     {
         XElement families = element.Element("families");
         foreach (XElement familyElement in families.Elements())
         {
             DeviceFamily family = new DeviceFamily(this);
             family.Deserialize(familyElement);
             Families.Add(family);
         }
     }
 }
        public virtual void Deserialize(XElement element)
        {
            if (string.Compare(element.Name.ToString(), "devicemanufacture") == 0)
            {
                // Parse the name
                XAttribute nameAttr = element.Attribute("name");
                if (nameAttr != null)
                {
                    Name = nameAttr.Value;
                }

                XElement families = element.Element("families");
                foreach (XElement familyElement in families.Elements())
                {
                    DeviceFamily family = new DeviceFamily(this);
                    family.Deserialize(familyElement);
                    Families.Add(family);
                }
            }
        }