private void init(EwfTableCell headerCell, Unit width, string cssClass)
 {
     ColumnSetup = new ColumnSetup {
         Width = width, CssClassOnAllCells = cssClass ?? ""
     };
     HeaderCell = headerCell;
 }
Пример #2
0
        private static string textAlignmentClass(EwfTableCell cell, EwfTableFieldOrItemSetup row, EwfTableFieldOrItemSetup column)
        {
            // NOTE: Think about whether the row or the column should win if nothing is specified on the cell.
            var alignments = new[] { cell.Setup.TextAlignment, row.TextAlignment, column.TextAlignment };

            return((from i in alignments select TextAlignmentStatics.Class(i)).FirstOrDefault(i => i.Length > 0) ?? "");
        }
Пример #3
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.Controls);
            if (colSpan == 1)
            {
                underlyingCell.Width = columnSetup.Width;
            }
            underlyingCell.CssClass = StringTools.ConcatenateWithDelimiter(
                " ",
                EwfTable.CssElementCreator.AllCellAlignmentsClass,
                columnSetup.CssClassOnAllCells,
                StringTools.ConcatenateWithDelimiter(" ", ewfCell.Setup.Classes.ToArray()));
            if (ewfCell.Setup.ClickScript != null)
            {
                ewfCell.Setup.ClickScript.SetUpClickableControl(underlyingCell);
            }

            if (!ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() || ewfCell.Setup.ToolTipControl != null || !columnSetup.ToolTipOnCells.IsNullOrWhiteSpace())
            {
                var toolTipControl = ewfCell.Setup.ToolTipControl ??
                                     ToolTip.GetToolTipTextControl(!ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() ? ewfCell.Setup.ToolTip : columnSetup.ToolTipOnCells);
                // NOTE: This comment is no longer accurate.
                // It is very important that we add the tool tip to the cell so that the tool tip is hidden if the row/cell is hidden.
                new ToolTip(toolTipControl, underlyingCell);
            }

            if (colSpan != 1)
            {
                underlyingCell.ColumnSpan = colSpan;
            }
            if (rowSpan != 1)
            {
                underlyingCell.RowSpan = rowSpan;
            }
            return(underlyingCell);
        }
 /// <summary>
 /// Creates an EWF table column with the specified header cell and width.
 /// </summary>
 public EwfTableColumn(EwfTableCell headerCell, Unit width)
 {
     init(headerCell, width, "");
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell and CSS class.
 /// </summary>
 public EwfTableColumn(EwfTableCell headerCell, string cssClass)
 {
     init(headerCell, Unit.Empty, cssClass);
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell, width, and CSS class.
 /// </summary>
 public EwfTableColumn(EwfTableCell headerCell, Unit width, string cssClass)
 {
     init(headerCell, width, cssClass);
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell.
 /// </summary>
 public EwfTableColumn(EwfTableCell headerCell)
 {
     init(headerCell, Unit.Empty, "");
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell and CSS class.
 /// </summary>
 public EwfTableColumn( EwfTableCell headerCell, string cssClass )
 {
     init( headerCell, Unit.Empty, cssClass );
 }
 private void init( EwfTableCell headerCell, Unit width, string cssClass )
 {
     ColumnSetup = new ColumnSetup { Width = width, CssClassOnAllCells = cssClass ?? "" };
     HeaderCell = headerCell;
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell and width.
 /// </summary>
 public EwfTableColumn( EwfTableCell headerCell, Unit width )
 {
     init( headerCell, width, "" );
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell.
 /// </summary>
 public EwfTableColumn( EwfTableCell headerCell )
 {
     init( headerCell, Unit.Empty, "" );
 }
 /// <summary>
 /// Creates an EWF table column with the specified header cell, width, and CSS class.
 /// </summary>
 public EwfTableColumn( EwfTableCell headerCell, Unit width, string cssClass )
 {
     init( headerCell, width, cssClass );
 }
Пример #13
0
 private static string textAlignmentClass( EwfTableCell cell, EwfTableFieldOrItemSetup row, EwfTableFieldOrItemSetup column )
 {
     // NOTE: Think about whether the row or the column should win if nothing is specified on the cell.
     var alignments = new[] { cell.Setup.TextAlignment, row.TextAlignment, column.TextAlignment };
     return ( from i in alignments select TextAlignmentStatics.Class( i ) ).FirstOrDefault( i => i.Length > 0 ) ?? "";
 }
Пример #14
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.Controls );
            if( colSpan == 1 )
                underlyingCell.Width = columnSetup.Width;
            underlyingCell.CssClass = StringTools.ConcatenateWithDelimiter(
                " ",
                EwfTable.CssElementCreator.AllCellAlignmentsClass,
                columnSetup.CssClassOnAllCells,
                StringTools.ConcatenateWithDelimiter( " ", ewfCell.Setup.Classes.ToArray() ) );
            if( ewfCell.Setup.ClickScript != null )
                ewfCell.Setup.ClickScript.SetUpClickableControl( underlyingCell );

            if( !ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() || ewfCell.Setup.ToolTipControl != null || !columnSetup.ToolTipOnCells.IsNullOrWhiteSpace() ) {
                var toolTipControl = ewfCell.Setup.ToolTipControl ??
                                     ToolTip.GetToolTipTextControl( !ewfCell.Setup.ToolTip.IsNullOrWhiteSpace() ? ewfCell.Setup.ToolTip : columnSetup.ToolTipOnCells );
                // NOTE: This comment is no longer accurate.
                // It is very important that we add the tool tip to the cell so that the tool tip is hidden if the row/cell is hidden.
                new ToolTip( toolTipControl, underlyingCell );
            }

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