コード例 #1
0
        //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);
            }
        }
コード例 #2
0
 public void Merge(ExcelCellMergeStatus mergeStatus)
 {
     foreach (var cell in Cells.Values)
     {
         cell.Merge(mergeStatus);
     }
 }
コード例 #3
0
ファイル: ExcelCellDiff.cs プロジェクト: crosslife/ExcelMerge
 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;
 }
コード例 #4
0
        public void Merge(int row, ExcelCellMergeStatus mergeStatus)
        {
            if (!Rows.ContainsKey(row))
            {
                return;
            }

            foreach (var cell in Rows[row].Cells)
            {
                Merge(row, cell.Key, mergeStatus);
            }
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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);
        }