Add() public méthode

public Add ( GridRow row ) : void
row GridRow
Résultat void
Exemple #1
0
        public GridLayer(RenderElement owner, int nColumns, int nRows, CellSizeStyle cellSizeStyle)
            : base(owner)
        {
            this.cellSizeStyle = cellSizeStyle;
            this.gridTable     = new GridTable();

            gridRows = gridTable.Rows;
            gridCols = gridTable.Columns;

            int columnWidth = owner.Width;

            if (nColumns > 0)
            {
                columnWidth      = columnWidth / nColumns;
                uniformCellWidth = columnWidth;
                if (columnWidth < 1)
                {
                    columnWidth = 1;
                }
            }

            //------------------------------------------------------------
            int cx = 0;

            for (int c = 0; c < nColumns; c++)
            {
                GridColumn col = new GridColumn(columnWidth);
                col.Width = columnWidth;
                col.Left  = cx;

                cx += columnWidth;
                gridCols.Add(col);
            }
            //------------------------------------------------------------

            if (nRows > 0)
            {
                int rowHeight = owner.Height / nRows;
                int cy        = 0;
                for (int r = 0; r < nRows; r++)
                {
                    var row = new GridRow(rowHeight);
                    gridRows.Add(row);

                    row.Height = rowHeight;
                    row.Top    = cy;
                    cy        += rowHeight;
                }
                uniformCellHeight = rowHeight;
            }
            //------------------------------------------------------------
        }
Exemple #2
0
        public GridLayer(RenderElement owner, int nColumns, int nRows, CellSizeStyle cellSizeStyle)
            : base(owner)
        {
            this.cellSizeStyle = cellSizeStyle;
            this.gridTable = new GridTable();
            gridRows = gridTable.Rows;
            gridCols = gridTable.Columns;
            int columnWidth = owner.Width;
            if (nColumns > 0)
            {
                columnWidth = columnWidth / nColumns;
                uniformCellWidth = columnWidth;
                if (columnWidth < 1)
                {
                    columnWidth = 1;
                }
            }

            //------------------------------------------------------------             
            int cx = 0;
            for (int c = 0; c < nColumns; c++)
            {
                GridColumn col = new GridColumn(columnWidth);
                col.Width = columnWidth;
                col.Left = cx;
                cx += columnWidth;
                gridCols.Add(col);
            }
            //------------------------------------------------------------

            if (nRows > 0)
            {
                int rowHeight = owner.Height / nRows;
                int cy = 0;
                for (int r = 0; r < nRows; r++)
                {
                    var row = new GridRow(rowHeight);
                    gridRows.Add(row);
                    row.Height = rowHeight;
                    row.Top = cy;
                    cy += rowHeight;
                }
                uniformCellHeight = rowHeight;
            }
            //------------------------------------------------------------
        }
Exemple #3
0
 public void AddRow(GridRow row) => _gridRows.Add(row);
Exemple #4
0
 public void AddRow(GridRow row)
 {
     gridRows.Add(row);
 }