ExcelCell

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NPOI.SS.UserModel;

namespace excelCompare
{
    internal class ExcelCell : IExcelCell
    {
        private int _rowIndex = -1;
        private int _columnIndex = -1;
        private string _value = null;
        private string _content = null;
        private CellType _cellType = CellType.Blank;

        public int rowIndex
        {
            get
            {
                return _rowIndex;
            }
        }

        public int columnIndex
        {
            get
            {
                return _columnIndex;
            }
        }

        public string value
        {
            get
            {
                return _value;
            }
        }

        public CellType cellType
        {
            get
            {
                return _cellType;
            }
        }

        public string GetContent()
        {
            if (_content == null )
            {
                return string.Empty;
            }
            return _content;
        }

        public ExcelCell(int rowIndex, int columnIndex, CellType cellType, string value)
        {
            _rowIndex = rowIndex;
            _columnIndex = columnIndex;
            _value = value;
            _content = value;
            _cellType = cellType;
            if ( !string.IsNullOrEmpty(_content) )
            {
                _content = _content.Replace("\r\n", SheetComparer.RETURN_NEWLINE_PLACE_HOLDER);
                _content = _content.Replace("\r", SheetComparer.RETURN_PLACE_HOLDER);
                _content = _content.Replace("\n", SheetComparer.NEWLINE_PLACE_HOLDER);
            }
        }

        public ExcelCell(int rowIndex, int columnIndex)
        {
            _rowIndex = rowIndex;
            _columnIndex = columnIndex;
            _cellType = CellType.Blank;
        }

        public void Save(ICell cell)
        {
            cell.SetCellValue(value);
        }
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值