//public ExcelCellDiff GetCell(int row, int col) //{ // if (!Rows.ContainsKey(row) || !Rows[row].Cells.ContainsKey(col)) // return null; // return Rows[row].Cells[col]; //} public void Merge(IEnumerable <int> rows, ExcelCellMergeStatus mergeStatus) { foreach (var row in rows) { Merge(row, mergeStatus); } }
public void Merge(ExcelCellMergeStatus mergeStatus) { foreach (var cell in Cells.Values) { cell.Merge(mergeStatus); } }
public ExcelCellDiff(int columnIndex, int rowIndex, ExcelCell src, ExcelCell dst, ExcelCellStatus status, ExcelCellMergeStatus mergeStatus = ExcelCellMergeStatus.None) { ColumnIndex = columnIndex; RowIndex = rowIndex; SrcCell = src; DstCell = dst; Status = status; MergeStatus = mergeStatus; }
public void Merge(int row, ExcelCellMergeStatus mergeStatus) { if (!Rows.ContainsKey(row)) { return; } foreach (var cell in Rows[row].Cells) { Merge(row, cell.Key, mergeStatus); } }
public void Merge(ExcelCellMergeStatus mergeStatus) { if (mergeStatus == ExcelCellMergeStatus.None) { return; } if (mergeStatus == ExcelCellMergeStatus.UseLeft) { DstCell.Value = SrcCell.Value; } else if (mergeStatus == ExcelCellMergeStatus.UseRight) { SrcCell.Value = DstCell.Value; } MergeStatus = mergeStatus; Status = ExcelCellStatus.None; }
public void Merge(int row, int col, ExcelCellMergeStatus mergeStatus) { if (!Rows.ContainsKey(row) || col >= Rows[row].Cells.Count) { return; } if (mergeStatus == ExcelCellMergeStatus.UseLeft) { var pickValue = _srcSheet.GetCellValue(row, col); _dstSheet.SetCell(row, col, pickValue); } else if (mergeStatus == ExcelCellMergeStatus.UseRight) { var pickValue = _dstSheet.GetCellValue(row, col); _srcSheet.SetCell(row, col, pickValue); } Rows[row].Cells[col].Merge(mergeStatus); }