/// <summary>
        /// Return a TableCellOptions with parameters to set specific properties
        /// </summary>
        /// <param name="FontFamily"></param>
        /// <param name="FontStyle"></param>
        /// <param name="FontWeight"></param>
        /// <param name="FontSize"></param>
        /// <param name="FontColor"></param>
        /// <param name="TextAlignment"></param>
        /// <param name="BackgroundColor"></param>
        /// <param name="CellPadding"></param>
        /// <returns></returns>
        public static TableCellOptions Set(
            TextFontFamily FontFamily   = null,
            TextFontStyle?FontStyle     = null,
            TextFontWeight?FontWeight   = null,
            double?FontSize             = null,
            Color?FontColor             = null,
            TextAlignment?TextAlignment = null,
            Color?BackgroundColor       = null,
            double?CellPadding          = null
            )
        {
            var value = new TableCellOptions();

            if (FontFamily != null)
            {
                value.FontOptions.FontFamily = FontFamily;
            }

            if (FontStyle.HasValue)
            {
                value.FontOptions.FontStyle = FontStyle.Value;
            }

            if (FontWeight.HasValue)
            {
                value.FontOptions.FontWeight = FontWeight.Value;
            }

            if (FontSize.HasValue)
            {
                value.FontOptions.FontSize = FontSize.Value;
            }

            if (FontColor.HasValue)
            {
                value.FontOptions.FontColor = FontColor.Value;
            }

            if (TextAlignment.HasValue)
            {
                value.TextAlignment = TextAlignment.Value;
            }

            if (BackgroundColor.HasValue)
            {
                value.BackgroundColor = BackgroundColor.Value;
            }

            if (CellPadding.HasValue)
            {
                value.CellPadding = CellPadding.Value;
            }

            return(value);
        }
Example #2
0
        /// <summary>
        /// Return a TableRowOptions with parameters to set specific properties
        /// </summary>
        /// <param name="TableCellOptions"></param>
        /// <returns></returns>
        public static TableRowOptions Set(
            TableCellOptions TableCellOptions = null
            )
        {
            var value = new TableRowOptions();

            if (TableCellOptions != null)
            {
                value.TableCellOptions = TableCellOptions;
            }

            return(value);
        }
Example #3
0
        /// <summary>
        /// Add a TableCell with value to the TableRow
        /// </summary>
        /// <param name="text"></param>
        /// <param name="options"></param>
        public void AddCell(string text, TableCellOptions options = null)
        {
            if (options == null)
            {
                options = this.Options.TableCellOptions;
            }

            var cell = new TableCell(text)
            {
                Options = options
            };

            this.Cells.Add(cell);
        }
Example #4
0
 /// <summary>
 /// Create a TextOptions with defaults
 /// </summary>
 public TableRowOptions()
 {
     this.TableCellOptions = new TableCellOptions();
 }