public static void ApplyGradientBackground(RowType pdfRowType, CellSharedData sharedData, Rectangle position, PdfContentByte[] canvases)
{
BaseColor startColor = null;
BaseColor endColor = null;
switch (pdfRowType)
{
case RowType.HeaderRow:
if (sharedData.Template.HeaderBackgroundColor.Count < 2) return;
startColor = sharedData.Template.HeaderBackgroundColor[0];
endColor = sharedData.Template.HeaderBackgroundColor[1];
break;
case RowType.PreviousPageSummaryRow:
if (sharedData.Template.PreviousPageSummaryRowBackgroundColor.Count < 2) return;
startColor = sharedData.Template.PreviousPageSummaryRowBackgroundColor[0];
endColor = sharedData.Template.PreviousPageSummaryRowBackgroundColor[1];
break;
case RowType.SummaryRow:
case RowType.AllGroupsSummaryRow:
if (sharedData.Template.SummaryRowBackgroundColor.Count < 2) return;
startColor = sharedData.Template.SummaryRowBackgroundColor[0];
endColor = sharedData.Template.SummaryRowBackgroundColor[1];
break;
case RowType.PageSummaryRow:
if (sharedData.Template.PageSummaryRowBackgroundColor.Count < 2) return;
startColor = sharedData.Template.PageSummaryRowBackgroundColor[0];
endColor = sharedData.Template.PageSummaryRowBackgroundColor[1];
break;
}
DrawGradientBackground(position, canvases, startColor, endColor);
}