Exemple #1
0
        public static XElement ToXElementSubGroups(XElement element, GroupProduct obj)
        {
            element.GetXElements("SubGroup").Remove();

            foreach (var sg in obj.SubGroups)
            {
                element.Add(SubGroupProduct.ToXElement(sg));
            }

            return(element);
        }
Exemple #2
0
        public static GroupProduct FromXElement(XContainer element)
        {
            var group = new GroupProduct(
                element.GetXAttributeValue("Group", "ID").ToInt(),
                element.GetXAttributeValue("Group", "Name"));

            foreach (var subGroup in element.Elements("SubGroup"))
            {
                group.SubGroups.Add(SubGroupProduct.FromXElement(subGroup, group));
            }

            return(group);
        }
Exemple #3
0
        public static XElement ToXElement(GroupProduct obj)
        {
            var groupElement = new XElement("Palette",
                                            new XElement("Group",
                                                         new XAttribute("Name", obj.Name),
                                                         new XAttribute("ID", obj.Id)));

            foreach (var sg in obj.SubGroups)
            {
                groupElement.Add(SubGroupProduct.ToXElement(sg));
            }

            return(groupElement);
        }
Exemple #4
0
 public static XElement ToXElement(SubGroupProduct obj)
 {
     return(new XElement("SubGroup",
                         new XAttribute("Name", obj.Name),
                         new XAttribute("ID", obj.Id)));
 }