public static CT_Cell Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_Cell ctObj = new CT_Cell(); ctObj.r = XmlHelper.ReadString(node.Attributes["r"]); ctObj.s = XmlHelper.ReadUInt(node.Attributes["s"]); if (node.Attributes["t"] != null) { ctObj.t = (ST_CellType)Enum.Parse(typeof(ST_CellType), node.Attributes["t"].Value); } ctObj.cm = XmlHelper.ReadUInt(node.Attributes["cm"]); ctObj.vm = XmlHelper.ReadUInt(node.Attributes["vm"]); ctObj.ph = XmlHelper.ReadBool(node.Attributes["ph"]); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == "f") { ctObj.f = CT_CellFormula.Parse(childNode, namespaceManager); } else if (childNode.LocalName == "v") { ctObj.v = childNode.InnerText; } else if (childNode.LocalName == "is") { ctObj.@is = CT_Rst.Parse(childNode, namespaceManager); } else if (childNode.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } } return(ctObj); }
public static CT_Cell Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_Cell ctObj = new CT_Cell(); ctObj.r = XmlHelper.ReadString(node.Attribute("r")); ctObj.s = XmlHelper.ReadUInt(node.Attribute("s")); if (node.Attribute("t") != null) { ctObj.t = (ST_CellType)Enum.Parse(typeof(ST_CellType), node.Attribute("t").Value); } ctObj.cm = XmlHelper.ReadUInt(node.Attribute("cm")); ctObj.vm = XmlHelper.ReadUInt(node.Attribute("vm")); ctObj.ph = XmlHelper.ReadBool(node.Attribute("ph")); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "f") { ctObj.f = CT_CellFormula.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "v") { ctObj.v = childNode.Value; } else if (childNode.Name.LocalName == "is") { ctObj.@is = CT_Rst.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } } return(ctObj); }