Ejemplo n.º 1
0
        /// <summary>
        /// Creates and formats a 'Header' styled <see cref="Generator.Cell"/> 
        /// for a given <see cref="row"/> and <see cref="headerCell"/>.
        /// </summary>
        /// <param name="row">row</param>
        /// <param name="headerCell">headerCell</param>
        public void CreateInnerTableHeaderCell(
            Generator.Row row,
            HeaderCell headerCell)
        {
            row.IsBroken = false;
            var cell = row.Cells.Add(headerCell.Content);
            cell.Padding = DefaultInnerPadding;
            cell.BackgroundColor = !string.IsNullOrEmpty(headerCell.BackgroundColor)
                ? new Generator.Color(headerCell.BackgroundColor)
                : new Generator.Color(Properties.Resources.HeaderTableBackgroundColor);
            cell.DefaultCellTextInfo.Color = new Generator.Color(Properties.Resources.WhiteColor);
            cell.DefaultCellTextInfo.FontName = Properties.Resources.ArialFont;
            cell.DefaultCellTextInfo.FontSize = DefaultInnerBodyFontSize;
            cell.DefaultCellTextInfo.IsTrueTypeFontBold = true;
            cell.DefaultCellTextInfo.IsUnicode = true;
            cell.IsNoBorder = headerCell.IsNoBorder;

            if (headerCell.IsCentralized)
            {
                cell.Alignment = AlignmentType.Center;
            }
            if (headerCell.Border != Generator.BorderSide.None)
            {
                cell.Border = new Generator.BorderInfo((int)headerCell.Border, DefaultBorderSize);
            }
            if (headerCell.RowSpan > 0)
            {
                cell.RowSpan = headerCell.RowSpan;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates and formats a 'Header' styled <see cref="Generator.Cell"/> for a 
 /// given <see cref="row"/> and <see cref="headerCells"/> provided.
 /// </summary>
 /// <param name="row">row</param>
 /// <param name="headerCells">headerCells</param>
 public void CreateInnerTableHeaderCells(
     Generator.Row row,
     HeaderCell[] headerCells)
 {
     foreach (var headerCell in headerCells)
     {
         CreateInnerTableHeaderCell(row, headerCell);
     }
 }