当前位置: 首页>>代码示例>>C#>>正文


C# Spreadsheet.CT_Xf类代码示例

本文整理汇总了C#中NPOI.OpenXmlFormats.Spreadsheet.CT_Xf的典型用法代码示例。如果您正苦于以下问题:C# CT_Xf类的具体用法?C# CT_Xf怎么用?C# CT_Xf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CT_Xf类属于NPOI.OpenXmlFormats.Spreadsheet命名空间,在下文中一共展示了CT_Xf类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse

 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;
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:29,代码来源:CT_Xf.cs

示例2: AddNewXf

 public CT_Xf AddNewXf()
 {
     if (this.xfField == null)
         this.xfField = new List<CT_Xf>();
     CT_Xf xf = new CT_Xf();
     this.xfField.Add(xf);
     return xf;
 }
开发者ID:kenlen,项目名称:npoi,代码行数:8,代码来源:CT_CellStyleXfs.cs

示例3: Copy

        public CT_Xf Copy()
        {
            CT_Xf obj = new CT_Xf();
            obj.alignmentField = this.alignmentField;
            obj.protectionField = this.protectionField;
            obj.extLstField = null == extLstField ? null : this.extLstField.Copy();

            obj.applyAlignmentField = this.applyAlignmentField;
            obj.applyBorderField = this.applyBorderField;
            obj.applyFillField = this.applyFillField;
            obj.applyFontField = this.applyFontField;
            obj.applyNumberFormatField = this.applyNumberFormatField;
            obj.applyProtectionField = this.applyProtectionField;
            obj.borderIdField = this.borderIdField;
            obj.fillIdField = this.fillIdField;
            obj.fontIdField = this.fontIdField;
            obj.numFmtIdField = this.numFmtIdField;
            obj.pivotButtonField = this.pivotButtonField;
            obj.quotePrefixField = this.quotePrefixField;
            obj.xfIdField = this.xfIdField;
            return obj;
        }
开发者ID:xiepeixing,项目名称:npoi,代码行数:22,代码来源:Styles.cs

示例4: CreateDefaultXf

 private static CT_Xf CreateDefaultXf()
 {
     CT_Xf ctXf = new CT_Xf();
     ctXf.numFmtId = 0;
     ctXf.fontId = 0;
     ctXf.fillId = 0;
     ctXf.borderId = 0;
     return ctXf;
 }
开发者ID:eatage,项目名称:npoi,代码行数:9,代码来源:StylesTable.cs

示例5: ReplaceCellStyleXfAt

 internal void ReplaceCellStyleXfAt(int idx, CT_Xf cellStyleXf)
 {
     styleXfs[idx] = cellStyleXf;
 }
开发者ID:eatage,项目名称:npoi,代码行数:4,代码来源:StylesTable.cs

示例6: PutCellStyleXf

 internal int PutCellStyleXf(CT_Xf cellStyleXf)
 {
     styleXfs.Add(cellStyleXf);
     return styleXfs.Count;
 }
开发者ID:eatage,项目名称:npoi,代码行数:5,代码来源:StylesTable.cs

示例7: ReplaceCellXfAt

 internal void ReplaceCellXfAt(int idx, CT_Xf cellXf)
 {
     xfs[idx] = cellXf;
 }
开发者ID:eatage,项目名称:npoi,代码行数:4,代码来源:StylesTable.cs

示例8: PutCellXf

 internal int PutCellXf(CT_Xf cellXf)
 {
     xfs.Add(cellXf);
     return xfs.Count;
 }
开发者ID:eatage,项目名称:npoi,代码行数:5,代码来源:StylesTable.cs

示例9: ReplaceCellXfAt

 public void ReplaceCellXfAt(int idx, CT_Xf cellXf)
 {
     xfs[idx] = cellXf;
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:4,代码来源:StylesTable.cs

示例10: PutCellXf

 public int PutCellXf(CT_Xf cellXf)
 {
     xfs.Add(cellXf);
     return xfs.Count;
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:5,代码来源:StylesTable.cs

示例11: Save

 public static void Save(Stream stream, CT_Xf font)
 {
     serializer.Serialize(stream, font, namespaces);
 }
开发者ID:xiepeixing,项目名称:npoi,代码行数:4,代码来源:Styles.cs

示例12: CreateCellStyle

 public XSSFCellStyle CreateCellStyle()
 {
     CT_Xf ctXf = new CT_Xf();
     ctXf.numFmtId = 0;
     ctXf.fontId = 0;
     ctXf.fillId = 0;
     ctXf.borderId = 0;
     ctXf.xfId = 0;
     int xfSize = styleXfs.Count;
     int indexXf = PutCellXf(ctXf);
     return new XSSFCellStyle(indexXf - 1, xfSize - 1, this, theme);
 }
开发者ID:eatage,项目名称:npoi,代码行数:12,代码来源:StylesTable.cs

示例13: TestGetSetColDefaultStyle

        public void TestGetSetColDefaultStyle()
        {
            XSSFWorkbook workbook = new XSSFWorkbook();
            XSSFSheet sheet = (XSSFSheet)workbook.CreateSheet();
            CT_Worksheet ctWorksheet = sheet.GetCTWorksheet();
            ColumnHelper columnHelper = sheet.GetColumnHelper();

            // POI column 3, OOXML column 4
            CT_Col col = columnHelper.GetOrCreateColumn1Based(4, false);

            Assert.IsNotNull(col);
            Assert.IsNotNull(columnHelper.GetColumn(3, false));
            columnHelper.SetColDefaultStyle(3, 2);
            Assert.AreEqual(2, columnHelper.GetColDefaultStyle(3));
            Assert.AreEqual(-1, columnHelper.GetColDefaultStyle(4));
            StylesTable stylesTable = workbook.GetStylesSource();
            CT_Xf cellXf = new CT_Xf();
            cellXf.fontId = (0);
            cellXf.fillId = (0);
            cellXf.borderId = (0);
            cellXf.numFmtId = (0);
            cellXf.xfId = (0);
            stylesTable.PutCellXf(cellXf);
            CT_Col col_2 = ctWorksheet.GetColsArray(0).AddNewCol();
            col_2.min = (10);
            col_2.max = (12);
            col_2.style = (1);
            col_2.styleSpecified = true;
            Assert.AreEqual(1, columnHelper.GetColDefaultStyle(11));
            XSSFCellStyle cellStyle = new XSSFCellStyle(0, 0, stylesTable, null);
            columnHelper.SetColDefaultStyle(11, cellStyle);
            Assert.AreEqual(0u, col_2.style);
            Assert.AreEqual(1, columnHelper.GetColDefaultStyle(10));
        }
开发者ID:ctddjyds,项目名称:npoi,代码行数:34,代码来源:TestColumnHelper.cs

示例14: TestSetDefaultColumnStyle

        public void TestSetDefaultColumnStyle()
        {
            XSSFWorkbook workbook = new XSSFWorkbook();
            XSSFSheet sheet = (XSSFSheet)workbook.CreateSheet();
            CT_Worksheet ctWorksheet = sheet.GetCTWorksheet();
            StylesTable stylesTable = workbook.GetStylesSource();
            XSSFFont font = new XSSFFont();
            font.FontName = ("Cambria");
            stylesTable.PutFont(font);
            CT_Xf cellStyleXf = new CT_Xf();
            cellStyleXf.fontId = (1);
            cellStyleXf.fillId= 0;
            cellStyleXf.borderId= 0;
            cellStyleXf.numFmtId= 0;
            stylesTable.PutCellStyleXf(cellStyleXf);
            CT_Xf cellXf = new CT_Xf();
            cellXf.xfId = (1);
            stylesTable.PutCellXf(cellXf);
            XSSFCellStyle cellStyle = new XSSFCellStyle(1, 1, stylesTable, null);
            Assert.AreEqual(1, cellStyle.FontIndex);

            sheet.SetDefaultColumnStyle(3, cellStyle);
            Assert.AreEqual(1u, ctWorksheet.GetColsArray(0).GetColArray(0).style);
        }
开发者ID:WPG,项目名称:npoi,代码行数:24,代码来源:TestXSSFSheet.cs

示例15: CreateCellStyle

 public XSSFCellStyle CreateCellStyle()
 {
     int xfSize = styleXfs.Count;
     if (xfSize > MAXIMUM_STYLE_ID)
         throw new InvalidOperationException("The maximum number of Cell Styles was exceeded. " +
                   "You can define up to " + MAXIMUM_STYLE_ID + " style in a .xlsx Workbook");
 
     CT_Xf ctXf = new CT_Xf();
     ctXf.numFmtId = 0;
     ctXf.fontId = 0;
     ctXf.fillId = 0;
     ctXf.borderId = 0;
     ctXf.xfId = 0;
     
     int indexXf = PutCellXf(ctXf);
     return new XSSFCellStyle(indexXf - 1, xfSize - 1, this, theme);
 }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:17,代码来源:StylesTable.cs


注:本文中的NPOI.OpenXmlFormats.Spreadsheet.CT_Xf类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。