Beispiel #1
0
        public static CT_PresetLineDashProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_PresetLineDashProperties ctObj = new CT_PresetLineDashProperties();

            if (node.Attributes["val"] != null)
            {
                ctObj.val = (ST_PresetLineDashVal)Enum.Parse(typeof(ST_PresetLineDashVal), node.Attributes["val"].Value);
            }
            return(ctObj);
        }
Beispiel #2
0
 public static CT_PresetLineDashProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_PresetLineDashProperties ctObj = new CT_PresetLineDashProperties();
     if (node.Attributes["val"] != null)
         ctObj.val = (ST_PresetLineDashVal)Enum.Parse(typeof(ST_PresetLineDashVal), node.Attributes["val"].Value);
     return ctObj;
 }
Beispiel #3
0
        public static CT_LineProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_LineProperties ctObj = new CT_LineProperties();

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