Exemplo n.º 1
0
 /// <summary>
 /// 设置列索引
 /// </summary>
 private void SetColumnIndex( Cell cell ) {
     if ( cell.ColumnIndex > 0 ) {
         _indexManager.AddIndex( cell.ColumnIndex,cell.ColumnSpan );
         return;
     }
     cell.ColumnIndex = _indexManager.GetIndex( cell.ColumnSpan );
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加单元格
 /// </summary>
 /// <param name="cell">单元格</param>
 public void Add( Cell cell ) {
     if ( cell == null )
         return;
     cell.Row = this;
     SetColumnIndex( cell );
     Cells.Add( cell );
 }
Exemplo n.º 3
0
 public void TestInit() {
     _cell = new Cell( "a" );
     _cell.Row = new Row(2);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 添加单元格
 /// </summary>
 private void AddCell( Row row, Cell cell, int rowIndex ) {
     row.Add( cell );
     if ( cell.RowSpan <= 1 )
         return;
     for ( int i = 1; i < cell.RowSpan; i++ )
         AddPlaceholderCell( cell, rowIndex + i );
 }
Exemplo n.º 5
0
 /// <summary>
 /// 为下方受rowspan影响的行添加占位单元格
 /// </summary>
 private void AddPlaceholderCell( Cell cell, int rowIndex ) {
     var row = CreateRow( rowIndex );
     row.Add( new NullCell { ColumnIndex = cell.ColumnIndex, ColumnSpan = cell.ColumnSpan } );
 }