public static CT_GradientFill Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_GradientFill ctObj = new CT_GradientFill(); if (node.Attributes["type"] != null) { ctObj.type = (ST_GradientType)Enum.Parse(typeof(ST_GradientType), node.Attributes["type"].Value); } ctObj.degree = XmlHelper.ReadDouble(node.Attributes["degree"]); ctObj.left = XmlHelper.ReadDouble(node.Attributes["left"]); ctObj.right = XmlHelper.ReadDouble(node.Attributes["right"]); ctObj.top = XmlHelper.ReadDouble(node.Attributes["top"]); ctObj.bottom = XmlHelper.ReadDouble(node.Attributes["bottom"]); ctObj.stop = new List <CT_GradientStop>(); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == "stop") { ctObj.stop.Add(CT_GradientStop.Parse(childNode, namespaceManager)); } } return(ctObj); }
public CT_GradientStop AddNewStop() { var newstop = new CT_GradientStop(); if (this.stop == null) { this.stop = new List <CT_GradientStop>(); } this.stop.Add(newstop); return(newstop); }
public static CT_GradientStop Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_GradientStop ctObj = new CT_GradientStop(); ctObj.positionField = XmlHelper.ReadDouble(node.Attributes["position"]); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == "color") { ctObj.colorField = CT_Color.Parse(childNode, namespaceManager); break; } } return(ctObj); }