Ejemplo n.º 1
0
        public static CT_LineJoinMiterProperties Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_LineJoinMiterProperties ctObj = new CT_LineJoinMiterProperties();

            ctObj.lim = XmlHelper.ReadInt(node.Attribute("lim"));
            return(ctObj);
        }
Ejemplo n.º 2
0
        public static CT_LineProperties Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_LineProperties ctObj = new CT_LineProperties();

            ctObj.w = XmlHelper.ReadInt(node.Attribute("w"));
            if (node.Attribute("cap") != null)
            {
                ctObj.cap = (ST_LineCap)Enum.Parse(typeof(ST_LineCap), node.Attribute("cap").Value);
            }
            if (node.Attribute("cmpd") != null)
            {
                ctObj.cmpd = (ST_CompoundLine)Enum.Parse(typeof(ST_CompoundLine), node.Attribute("cmpd").Value);
            }
            if (node.Attribute("algn") != null)
            {
                ctObj.algn = (ST_PenAlignment)Enum.Parse(typeof(ST_PenAlignment), node.Attribute("algn").Value);
            }
            ctObj.custDash = new List <CT_DashStop>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "noFill")
                {
                    ctObj.noFill = new CT_NoFillProperties();
                }
                else if (childNode.Name.LocalName == "solidFill")
                {
                    ctObj.solidFill = CT_SolidColorFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "gradFill")
                {
                    ctObj.gradFill = CT_GradientFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "pattFill")
                {
                    ctObj.pattFill = CT_PatternFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "prstDash")
                {
                    ctObj.prstDash = CT_PresetLineDashProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "round")
                {
                    ctObj.round = new CT_LineJoinRound();
                }
                else if (childNode.Name.LocalName == "bevel")
                {
                    ctObj.bevel = new CT_LineJoinBevel();
                }
                else if (childNode.Name.LocalName == "miter")
                {
                    ctObj.miter = CT_LineJoinMiterProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "headEnd")
                {
                    ctObj.headEnd = CT_LineEndProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "tailEnd")
                {
                    ctObj.tailEnd = CT_LineEndProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "custDash")
                {
                    ctObj.custDash.Add(CT_DashStop.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }