public XSSFDxfStyleProvider(CT_Dxf dxf, int stripeSize, IIndexedColorMap colorMap) { this.stripeSize = stripeSize; this.colorMap = colorMap; if (dxf == null) { border = null; font = null; number = null; fill = null; } else { border = dxf.IsSetBorder() ? new XSSFBorderFormatting(dxf.border) : null; font = dxf.IsSetFont() ? new XSSFFontFormatting(dxf.font) : null; if (dxf.IsSetNumFmt()) { CT_NumFmt numFmt = dxf.numFmt; number = new ExcelNumberFormat((int)numFmt.numFmtId, numFmt.formatCode); } else { number = null; } fill = dxf.IsSetFill() ? new XSSFPatternFormatting(dxf.fill) : null; } }
public XSSFTableStyle(int index, CT_Dxfs dxfs, CT_TableStyle tableStyle, IIndexedColorMap colorMap) { this.name = tableStyle.name; this.index = index; List <CT_Dxf> dxfList = dxfs.dxf; foreach (CT_TableStyleElement element in tableStyle.tableStyleElement) { TableStyleType type = Enums.Parse <TableStyleType>(element.type.GetName()); DifferentialStyleProvider dstyle = null; if (element.dxfIdSpecified) { int idx = (int)element.dxfId; CT_Dxf dxf; dxf = dxfList[idx]; int stripeSize = 0; if (element.size != 0) { stripeSize = (int)element.size; } if (dxf != null) { dstyle = new XSSFDxfStyleProvider(dxf, stripeSize, colorMap); } } elementMap.Add(type, dstyle); } }