PdfRpt.Calendar.MonthCalendar.addCells C# (CSharp) Method

addCells() private method

private addCells ( IEnumerable monthCells ) : void
monthCells IEnumerable
return void
        private void addCells(IEnumerable<MonthTableCell> monthCells)
        {
            int number = 0;
            foreach (var cell in monthCells)
            {
                number++;
                if (number == 36)
                {
                    if (cell.DayNumber == 0)
                        return;
                }

                if (cell.DayNumber == 0)
                {
                    var empryCell = new PdfPCell();
                    setCommonPdfPCellProperties(empryCell);
                    _mainTable.AddCell(empryCell);
                    continue;
                }

                cell.DescriptionCell = createCellDescription(cell);
                if (cell.DescriptionCell == null)
                {
                    if (CalendarAttributes.CellsCustomizer != null)
                        CalendarAttributes.CellsCustomizer(cell);

                    _mainTable.AddCell(cell.NumberCell);
                }
                else
                {
                    var cellTable = new PdfPTable(1)
                    {
                        WidthPercentage = 100,
                        RunDirection = runDirection
                    };
                    cell.NumberCell.Border = 0;
                    cell.DescriptionCell.Border = 0;
                    cell.DescriptionCell.HorizontalAlignment = (int)CalendarAttributes.DescriptionHorizontalAlignment;

                    if (CalendarAttributes.CellsCustomizer != null)
                        CalendarAttributes.CellsCustomizer(cell);

                    cellTable.AddCell(cell.NumberCell);
                    cellTable.AddCell(cell.DescriptionCell);
                    var tableCell = new PdfPCell(cellTable);
                    setCommonPdfPCellProperties(tableCell);
                    _mainTable.AddCell(tableCell);
                }
            }
        }