Esempio n. 1
0
 internal ICellStyle CreateCellStyle(RowStyle rowStyle)
 {
     IColor borderColor = CreateColor(rowStyle.BorderColor);
     IColor backColor = CreateColor(rowStyle.BackColor);
     IFont font = CreateFont(rowStyle);
     switch (ExcelVersion)
     {
         case ExcelVersion.XLS:
             var CellStyleXLS = new XLSStrategyStyle(ExcelXls);
             return CellStyleXLS.GetCellStyle(backColor, borderColor, font);
         case ExcelVersion.XLSX:
             var CellStyleXLSX = new XLSXStrategyStyle(ExcelXlsx);
             return CellStyleXLSX.GetCellStyle(backColor, borderColor, font);
         default:
             throw new Exception(ErrorMessage.Excel_BadVersion);
     }
 }
Esempio n. 2
0
 internal IFont CreateFont(RowStyle rowStyle)
 {
     IColor color = CreateColor(rowStyle.FontColor);
     switch (ExcelVersion){
         case ExcelVersion.XLS:
             var fontExcelXls = new XLSStrategyStyle(ExcelXls);
             return fontExcelXls.GetFont(rowStyle.FontSize, rowStyle.FontName, color);
         case ExcelVersion.XLSX:
             var fontExcelXlsx = new XLSXStrategyStyle(ExcelXlsx);
             return fontExcelXlsx.GetFont(rowStyle.FontSize, rowStyle.FontName, color);
         default:
             throw new Exception(ErrorMessage.Excel_BadVersion);
     }
 }