Example #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);
        }
Example #2
0
        internal static void DrawRow(
            Table table, RowSetup rowSetup, List <CellPlaceholder> rowPlaceholder, List <ColumnSetup> columnSetups, bool tableIsColumnPrimary)
        {
            var row = new TableRow();

            rowSetup.UnderlyingTableRow = row;
            table.Rows.Add(row);

            row.CssClass = rowSetup.CssClass;
            if (rowSetup.ActivationBehavior != null)
            {
                rowSetup.ActivationBehavior.SetUpClickableControl(row);
            }

            for (var i = 0; i < rowPlaceholder.Count; i++)
            {
                if (rowPlaceholder[i] is EwfTableCell)
                {
                    row.Cells.Add(buildCell(rowPlaceholder[i] as EwfTableCell, rowSetup, columnSetups[i], tableIsColumnPrimary));
                }
            }
        }