A cell in a table.
Inheritance: CellPlaceholder
示例#1
0
        private static TableCell buildCell(EwfTableCell ewfCell, RowSetup rowSetup, ColumnSetup columnSetup, bool tableIsColumnPrimary)
        {
            var colSpan = tableIsColumnPrimary ? ewfCell.Setup.ItemSpan : ewfCell.Setup.FieldSpan;
            var rowSpan = tableIsColumnPrimary ? ewfCell.Setup.FieldSpan : ewfCell.Setup.ItemSpan;

            var underlyingCell = rowSetup.IsHeader || columnSetup.IsHeader ? new TableHeaderCell() : new TableCell();

            underlyingCell.AddControlsReturnThis((ewfCell.Content ?? Enumerable.Empty <FlowComponent>()).GetControls());
            if (colSpan == 1)
            {
                underlyingCell.Width = columnSetup.Width;
            }
            underlyingCell.CssClass = StringTools.ConcatenateWithDelimiter(
                " ",
                TableCssElementCreator.AllCellAlignmentsClass.ClassName,
                columnSetup.CssClassOnAllCells,
                StringTools.ConcatenateWithDelimiter(" ", ewfCell.Setup.Classes.ToArray()));
            if (ewfCell.Setup.ActivationBehavior != null)
            {
                ewfCell.Setup.ActivationBehavior.SetUpClickableControl(underlyingCell);
            }

            if (colSpan != 1)
            {
                underlyingCell.ColumnSpan = colSpan;
            }
            if (rowSpan != 1)
            {
                underlyingCell.RowSpan = rowSpan;
            }

            ewfCell.Setup.EtherealContent.AddEtherealControls(underlyingCell);

            return(underlyingCell);
        }
示例#2
0
 /// <summary>
 /// Returns a sequence of two table cells.
 /// </summary>
 public static IEnumerable <EwfTableCell> Append(this EwfTableCell first, EwfTableCell second) =>
 Enumerable.Empty <EwfTableCell>().Append(first).Append(second);
示例#3
0
 /// <summary>
 /// Concatenates table cells.
 /// </summary>
 public static IEnumerable <EwfTableCell> Concat(this EwfTableCell first, IEnumerable <EwfTableCell> second) => second.Prepend(first);