コード例 #1
0
        public ExcelRow GetRow(UInt32 rowIndex)
        {
            if (rowIndex < 1)
            {
                throw new ArgumentException("Index row can not be less than 1!");
            }
            if (this.List.ContainsKey(rowIndex))
            {
                return(this.List[rowIndex]);
            }

            Row newRow = new Row()
            {
                RowIndex = rowIndex
            };
            ExcelRow nextRow = this.List.FirstOrDefault(p => p.Key > rowIndex).Value;

            if (nextRow != null)
            {
                sheet.worksheet.GetFirstChild <SheetData>().InsertBefore(newRow, nextRow.row);
            }
            else
            {
                sheet.worksheet.GetFirstChild <SheetData>().Append(newRow);
            }

            ExcelRow retVal = new ExcelRow(newRow, sheet);

            this.List.Add(rowIndex, retVal);

            return(retVal);
        }
コード例 #2
0
 public ExcelCellCollection(ExcelRow row)
 {
     this.row  = row;
     this.List = new SortedDictionary <uint, ExcelCell>();
     foreach (Cell cell in row.row.Elements <Cell>())
     {
         ExcelCell newCell = new ExcelCell(cell, row);
         this.List.Add(newCell.Index, newCell);
     }
 }
コード例 #3
0
ファイル: OpenXmlExcel.cs プロジェクト: siwigor/OpenXmlExcel
        public ExcelRow GetRow(UInt32 rowIndex)
        {
            if (rowIndex < 1) throw new ArgumentException("Index row can not be less than 1!");
            if (this.List.ContainsKey(rowIndex))
                return this.List[rowIndex];

            Row newRow = new Row() { RowIndex = rowIndex };
            ExcelRow nextRow = this.List.FirstOrDefault(p => p.Key > rowIndex).Value;
            if(nextRow != null)
                sheet.worksheet.GetFirstChild<SheetData>().InsertBefore(newRow, nextRow.row);
            else
                sheet.worksheet.GetFirstChild<SheetData>().Append(newRow);

            ExcelRow retVal = new ExcelRow(newRow, sheet);
            this.List.Add(rowIndex, retVal);

            return retVal;
        }
コード例 #4
0
ファイル: OpenXmlExcel.cs プロジェクト: siwigor/OpenXmlExcel
 public ExcelCellCollection(ExcelRow row)
 {
     this.row = row;
     this.List = new SortedDictionary<uint, ExcelCell>();
     foreach (Cell cell in row.row.Elements<Cell>())
     {
         ExcelCell newCell = new ExcelCell(cell, row);
         this.List.Add(newCell.Index, newCell);
     }
 }
コード例 #5
0
ファイル: OpenXmlExcel.cs プロジェクト: siwigor/OpenXmlExcel
 public ExcelCell(Cell cell, ExcelRow row)
 {
     this.row = row;
     this.cell = cell;
 }
コード例 #6
0
 public ExcelCell(Cell cell, ExcelRow row)
 {
     this.row  = row;
     this.cell = cell;
 }