예제 #1
0
파일: CT_Xf.cs 프로젝트: zzy092/npoi
 public static CT_Xf Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_Xf ctObj = new CT_Xf();
     ctObj.numFmtId = XmlHelper.ReadUInt(node.Attributes["numFmtId"]);
     ctObj.fontId = XmlHelper.ReadUInt(node.Attributes["fontId"]);
     ctObj.fillId = XmlHelper.ReadUInt(node.Attributes["fillId"]);
     ctObj.borderId = XmlHelper.ReadUInt(node.Attributes["borderId"]);
     ctObj.xfId = XmlHelper.ReadUInt(node.Attributes["xfId"]);
     ctObj.quotePrefix = XmlHelper.ReadBool(node.Attributes["quotePrefix"]);
     ctObj.pivotButton = XmlHelper.ReadBool(node.Attributes["pivotButton"]);
     ctObj.applyNumberFormat = XmlHelper.ReadBool(node.Attributes["applyNumberFormat"]);
     ctObj.applyFont = XmlHelper.ReadBool(node.Attributes["applyFont"]);
     ctObj.applyFill = XmlHelper.ReadBool(node.Attributes["applyFill"]);
     ctObj.applyBorder = XmlHelper.ReadBool(node.Attributes["applyBorder"]);
     ctObj.applyAlignment = XmlHelper.ReadBool(node.Attributes["applyAlignment"]);
     ctObj.applyProtection = XmlHelper.ReadBool(node.Attributes["applyProtection"]);
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "alignment")
             ctObj.alignment = CT_CellAlignment.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "protection")
             ctObj.protection = CT_CellProtection.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "extLst")
             ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
     }
     return ctObj;
 }
예제 #2
0
        public static CT_CellAlignment Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_CellAlignment ctObj = new CT_CellAlignment();

            if (node.Attributes["horizontal"] != null)
            {
                ctObj.horizontal = (ST_HorizontalAlignment)Enum.Parse(typeof(ST_HorizontalAlignment), node.Attributes["horizontal"].Value);
            }
            if (node.Attributes["vertical"] != null)
            {
                ctObj.vertical = (ST_VerticalAlignment)Enum.Parse(typeof(ST_VerticalAlignment), node.Attributes["vertical"].Value);
            }
            ctObj.textRotation    = XmlHelper.ReadLong(node.Attributes["textRotation"]);
            ctObj.wrapText        = XmlHelper.ReadBool(node.Attributes["wrapText"]);
            ctObj.indent          = XmlHelper.ReadLong(node.Attributes["indent"]);
            ctObj.relativeIndent  = XmlHelper.ReadInt(node.Attributes["relativeIndent"]);
            ctObj.justifyLastLine = XmlHelper.ReadBool(node.Attributes["justifyLastLine"]);
            ctObj.shrinkToFit     = XmlHelper.ReadBool(node.Attributes["shrinkToFit"]);
            ctObj.readingOrder    = XmlHelper.ReadLong(node.Attributes["readingOrder"]);
            return(ctObj);
        }
예제 #3
0
        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);
        }
예제 #4
0
 public static CT_CellAlignment Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_CellAlignment ctObj = new CT_CellAlignment();
     if (node.Attributes["horizontal"] != null)
         ctObj.horizontal = (ST_HorizontalAlignment)Enum.Parse(typeof(ST_HorizontalAlignment), node.Attributes["horizontal"].Value);
     if (node.Attributes["vertical"] != null)
         ctObj.vertical = (ST_VerticalAlignment)Enum.Parse(typeof(ST_VerticalAlignment), node.Attributes["vertical"].Value);
     ctObj.textRotation = XmlHelper.ReadLong(node.Attributes["textRotation"]);
     ctObj.wrapText = XmlHelper.ReadBool(node.Attributes["wrapText"]);
     ctObj.indent = XmlHelper.ReadLong(node.Attributes["indent"]);
     ctObj.relativeIndent = XmlHelper.ReadInt(node.Attributes["relativeIndent"]);
     ctObj.justifyLastLine = XmlHelper.ReadBool(node.Attributes["justifyLastLine"]);
     ctObj.shrinkToFit = XmlHelper.ReadBool(node.Attributes["shrinkToFit"]);
     ctObj.readingOrder = XmlHelper.ReadLong(node.Attributes["readingOrder"]);
     return ctObj;
 }
예제 #5
0
파일: CT_Dxfs.cs 프로젝트: gechan/npoi
        public static CT_Dxf Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Dxf ctObj = new CT_Dxf();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "font")
                {
                    ctObj.font = CT_Font.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "numFmt")
                {
                    ctObj.numFmt = CT_NumFmt.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "fill")
                {
                    ctObj.fill = CT_Fill.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "alignment")
                {
                    ctObj.alignment = CT_CellAlignment.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "border")
                {
                    ctObj.border = CT_Border.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "protection")
                {
                    ctObj.protection = CT_CellProtection.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
예제 #6
0
 /**
  * Creates a Cell Alignment from the supplied XML defInition
  *
  * @param cellAlignment
  */
 public XSSFCellAlignment(CT_CellAlignment cellAlignment)
 {
     this.cellAlignement = cellAlignment;
 }
예제 #7
0
파일: CT_Xf.cs 프로젝트: fulgore7/npoi
 public void UnsetAlignment()
 {
     this.alignmentField = null;
 }
예제 #8
0
파일: CT_Xf.cs 프로젝트: Reinakumiko/npoi
 public void UnsetAlignment()
 {
     this.alignmentField = null;
 }
예제 #9
0
 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;
 }