Example #1
0
        protected string GetAttributeGroupName(CustomXmlAttribute.eAttributeGroup attributeGroup)
        {
            switch (attributeGroup)
            {
            case CustomXmlAttribute.eAttributeGroup.Animation: return("animation");

            case CustomXmlAttribute.eAttributeGroup.Button: return("button");

            case CustomXmlAttribute.eAttributeGroup.Events: return("events");

            case CustomXmlAttribute.eAttributeGroup.Image: return("image");

            case CustomXmlAttribute.eAttributeGroup.LayoutBase: return("layoutBase");

            case CustomXmlAttribute.eAttributeGroup.LayoutElement: return("layoutElement");

            case CustomXmlAttribute.eAttributeGroup.RectPosition: return("rectPosition");

            case CustomXmlAttribute.eAttributeGroup.RectTransform: return("rectTransform");

            case CustomXmlAttribute.eAttributeGroup.AllElements: return("simpleAttributes");

            case CustomXmlAttribute.eAttributeGroup.Text: return("text");

            case CustomXmlAttribute.eAttributeGroup.Dragging: return("dragging");

            case CustomXmlAttribute.eAttributeGroup.Tooltip: return("tooltip");
            }

            return(null);
        }
Example #2
0
        protected List <string> GetAttributeGroup(CustomXmlAttribute.eAttributeGroup attributeGroup)
        {
            var attributeGroupName = GetAttributeGroupName(attributeGroup);

            if (attributeGroupName == null)
            {
                return(new List <string>());
            }

            var ag = schemaElement.Elements(ns + "attributeGroup")
                     .First(s => {
                var name = s.Attribute("name");
                if (name != null)
                {
                    return(name.Value.Equals(attributeGroupName, StringComparison.OrdinalIgnoreCase));
                }

                return(false);
            });

            return(ag.Elements()
                   .Where(e => e.Name.LocalName == "attribute")
                   .Select(e => e.Attribute("name").Value)
                   .ToList());
        }