示例#1
0
        public CellRangeRef(string sheetName, CellRef start, CellRef end)
        {
            this.sheetName = sheetName;

            this.start = new CellRef(start);
            this.end   = new CellRef(end);

            Reorder();
        }
示例#2
0
        public ExcelHelper(string templateFileName, string generatedFileName)
        {
            File.Copy(templateFileName, generatedFileName, true /*overwrite*/);

            document = SpreadsheetDocument.Open(generatedFileName, true /*isEditable*/);

            currentPosition = new CellRef(1, 1);//1 based indexing

            direction = DirectionType.TOP_TO_DOWN;
        }
示例#3
0
        public CellRangeRef(string value)
        {
            var match = PATTERN.Match(value);

            sheetName = match.Groups[1].Value;
            start     = new CellRef(match.Groups[3].Value, match.Groups[2].Value);

            string endColumn = match.Groups[4].Value;

            if (endColumn.Length == 0)
            {
                end = new CellRef(start);
            }
            else
            {
                end = new CellRef(match.Groups[5].Value, endColumn);
            }
        }
示例#4
0
 public CellRef(CellRef right)
 {
     row    = right.row;
     column = right.column;
 }
示例#5
0
 public void OffsetIt(CellRef value)
 {
     row    += value.row;
     column += value.column;
 }
示例#6
0
 public CellRef CalculateOffset(CellRef value)
 {
     return(new CellRef(row - value.row, column - value.column));
 }
示例#7
0
        public override bool Equals(object obj)
        {
            CellRef right = (CellRef)obj;

            return(row == right.row && column == right.Column);
        }
示例#8
0
 static public string ToString(int row, int column)
 {
     return(string.Format("{0}{1}", CellRef.Int2Column(column), row));
 }