public static CT_CellAlignment Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_CellAlignment ctObj = new CT_CellAlignment(); if (node.Attribute("horizontal") != null) { ctObj.horizontal = (ST_HorizontalAlignment)Enum.Parse(typeof(ST_HorizontalAlignment), node.Attribute("horizontal").Value); } if (node.Attribute("vertical") != null) { ctObj.vertical = (ST_VerticalAlignment)Enum.Parse(typeof(ST_VerticalAlignment), node.Attribute("vertical").Value); } ctObj.textRotation = XmlHelper.ReadLong(node.Attribute("textRotation")); ctObj.wrapText = XmlHelper.ReadBool(node.Attribute("wrapText")); ctObj.indent = XmlHelper.ReadLong(node.Attribute("indent")); ctObj.relativeIndent = XmlHelper.ReadInt(node.Attribute("relativeIndent")); ctObj.justifyLastLine = XmlHelper.ReadBool(node.Attribute("justifyLastLine")); ctObj.shrinkToFit = XmlHelper.ReadBool(node.Attribute("shrinkToFit")); ctObj.readingOrder = XmlHelper.ReadLong(node.Attribute("readingOrder")); return(ctObj); }
internal CT_CellAlignment Copy() { CT_CellAlignment align = new CT_CellAlignment(); align.horizontal = this.horizontal; align.vertical = this.vertical; align.wrapText = this.wrapText; align.shrinkToFit = this.shrinkToFit; align.textRotation = this.textRotation; align.justifyLastLine = this.justifyLastLine; align.readingOrder = this.readingOrder; align.relativeIndent = this.relativeIndent; align.indent = this.indent; return(align); }
public static CT_Dxf Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_Dxf ctObj = new CT_Dxf(); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "font") { ctObj.font = CT_Font.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "numFmt") { ctObj.numFmt = CT_NumFmt.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "fill") { ctObj.fill = CT_Fill.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "alignment") { ctObj.alignment = CT_CellAlignment.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "border") { ctObj.border = CT_Border.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "protection") { ctObj.protection = CT_CellProtection.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } } return(ctObj); }
public static CT_Xf Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_Xf ctObj = new CT_Xf(); ctObj.numFmtId = XmlHelper.ReadUInt(node.Attribute("numFmtId")); ctObj.fontId = XmlHelper.ReadUInt(node.Attribute("fontId")); ctObj.fillId = XmlHelper.ReadUInt(node.Attribute("fillId")); ctObj.borderId = XmlHelper.ReadUInt(node.Attribute("borderId")); ctObj.xfId = XmlHelper.ReadUInt(node.Attribute("xfId")); ctObj.quotePrefix = XmlHelper.ReadBool(node.Attribute("quotePrefix")); ctObj.pivotButton = XmlHelper.ReadBool(node.Attribute("pivotButton")); ctObj.applyNumberFormat = XmlHelper.ReadBool(node.Attribute("applyNumberFormat")); ctObj.applyFont = XmlHelper.ReadBool(node.Attribute("applyFont")); ctObj.applyFill = XmlHelper.ReadBool(node.Attribute("applyFill")); ctObj.applyBorder = XmlHelper.ReadBool(node.Attribute("applyBorder")); ctObj.applyAlignment = XmlHelper.ReadBool(node.Attribute("applyAlignment")); ctObj.applyProtection = XmlHelper.ReadBool(node.Attribute("applyProtection")); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "alignment") { ctObj.alignment = CT_CellAlignment.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "protection") { ctObj.protection = CT_CellProtection.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } } return(ctObj); }
public void UnsetAlignment() { this.alignmentField = null; }