Example #1
0
        public ITableCell AddCell(int columnSpan, s.TableCellStyle style, t.TrackingInfo trackingInfo)
        {
            TableCell cell = new TableCell(columnSpan, style, trackingInfo);

            _cells.Add(cell);
            return(cell);
        }
Example #2
0
 public TableCell(int columnSpan, s.TableCellStyle style, t.TrackingInfo trackingInfo)
 {
     _columnSpan   = columnSpan;
     _style        = style;
     _trackingInfo = trackingInfo;
     _content      = new List <IBlockContent>();
 }
Example #3
0
        private void RenderPhotoRow(PhotoRowLayout layout, ITableRow row)
        {
            //	In the design we represent a photo row as a pair of table rows
            //	without a table: one row for the photos, and the other for the
            //	captions. This design is useful for PDF, and requires special
            //	handling of borders to make the vertical pairs of cells (photo
            //	cell and caption cell) appear as a single cell. But it's not
            //	necessary in Word because we can just add the photo and caption
            //	as two paragraphs in a single cell. So deconstruct the photo
            //	row into its pairs of cells and then render each pair as a
            //	single cell.
            for (int x = 0; x < layout.NumPhotos; ++x)
            {
                PhotoLayout photoCell   = (PhotoLayout)layout.PhotoRow.GetSubLayoutAtIndex(x).GetSubLayoutAtIndex(0);
                TextLayout  captionCell = (TextLayout)layout.CaptionRow.GetSubLayoutAtIndex(x).GetSubLayoutAtIndex(0);

                s.TableCellStyle cellStyle = null;
                if (layout.Style != null)
                {
                    s.PhotoStyle photoStyle = (s.PhotoStyle)layout.Style;
                    cellStyle = new s.TableCellStyle
                    {
                        Padding = photoStyle.Padding
                    };
                }
                ITableCell cell = row.AddCell(1, cellStyle, layout.TrackingInfo);
                RenderPhoto(photoCell, cell);
                RenderText(captionCell, cell);
            }
        }