Exemplo n.º 1
0
        private string getCellDescription(MonthTableCell cell)
        {
            if (CalendarData.MonthDaysInfo == null || !CalendarData.MonthDaysInfo.Any())
            {
                return(string.Empty);
            }

            var daysInfo = CalendarData.MonthDaysInfo.Where(x => x.DayNumber == cell.DayNumber).ToList();

            if (!daysInfo.Any())
            {
                return(string.Empty);
            }

            var text = new StringBuilder();

            foreach (var day in daysInfo)
            {
                if (day.ShowDescriptionInFooter)
                {
                    _footerText.AppendLine(day.DayNumber + " " + _monthName + ": " + day.Description);
                }
                else
                {
                    text.AppendLine(day.Description);
                }
            }
            return(text.ToString());
        }
Exemplo n.º 2
0
        private PdfPCell createCellDescription(MonthTableCell cell)
        {
            var      cellDescription = getCellDescription(cell);
            PdfPCell descriptionCell = null;

            if (!string.IsNullOrEmpty(cellDescription))
            {
                descriptionCell = new PdfPCell(getPhrase(cellDescription));
            }
            return(descriptionCell);
        }
Exemplo n.º 3
0
        private List <MonthTableCell> createEmptyCells()
        {
            var monthCells = new List <MonthTableCell>();

            for (var idx = 0; idx <= 41; idx++)
            {
                var numberCell = new PdfPCell();
                setCommonPdfPCellProperties(numberCell);
                var monthCell = new MonthTableCell
                {
                    NumberCell      = numberCell,
                    DescriptionCell = null
                };
                monthCells.Add(monthCell);
            }
            return(monthCells);
        }