private void _CreateChildSheetNode(IWorkbook iWorkBook, string fileName, GlobalConfig.OUTPUT_TYPE outputType) { for (int i = 0; i < iWorkBook.NumberOfSheets; i++) { ISheet iSheet = iWorkBook.GetSheetAt(i); _listExcelNode.Add(new SheetNode(iSheet, fileName, outputType)); } }
private void _CreateChildRowNode(ISheet iSheet, GlobalConfig.OUTPUT_TYPE outputType) { for (int i = iSheet.FirstRowNum + 1; i <= iSheet.LastRowNum; i++) { IRow iRow = iSheet.GetRow(i); bool isKeyRow = (i == (iSheet.FirstRowNum + 1)); if (isKeyRow) { _keyRowNode = new RowNode(iRow, outputType); } else { RowNode rowNode = new RowNode(iRow, outputType); rowNode.SetKeyRowNode(_keyRowNode); _listExcelNode.Add(rowNode); } } }
public override IExcelNodeRead GetExcelNodeReadModule(GlobalConfig.OUTPUT_TYPE type) { switch (type) { case GlobalConfig.OUTPUT_TYPE.LUA_ARRAY: return(new SheetDataToLuaArray(this)); case GlobalConfig.OUTPUT_TYPE.LUA_TABLE: return(new SheetDataToLuaTable(this)); case GlobalConfig.OUTPUT_TYPE.JSON_ARRAY: return(new SheetDataToJsonArray(this)); case GlobalConfig.OUTPUT_TYPE.JSON_OBJECT: return(new SheetDataToJsonObject(this)); } return(null); }
public SheetNode(ISheet iSheet, string fileName, GlobalConfig.OUTPUT_TYPE outputType) { _outputType = outputType; _fileName = fileName; _CreateChildRowNode(iSheet, outputType); }
public RowNode(IRow iRow, GlobalConfig.OUTPUT_TYPE outputType) { _outputType = outputType; _CreateChildCellNode(iRow); }
public abstract IExcelNodeRead GetExcelNodeReadModule(GlobalConfig.OUTPUT_TYPE type);
public override IExcelNodeRead GetExcelNodeReadModule(GlobalConfig.OUTPUT_TYPE type) { return(null); }
public FileNode(IWorkbook iWorkBook, string fileName, GlobalConfig.OUTPUT_TYPE outputType) { _outputType = outputType; _fileName = fileName; _CreateChildSheetNode(iWorkBook, fileName, _outputType); }