Aspose.Cells.Examples.CSharp.Formatting.ConditionalFormatting.GetFormatCondition C# (CSharp) Method

GetFormatCondition() private method

private GetFormatCondition ( string cellAreaName, Color color ) : FormatConditionCollection
cellAreaName string
color Color
return FormatConditionCollection
        private FormatConditionCollection GetFormatCondition(string cellAreaName, Color color)
        {
            // Adds an empty conditional formattings
            int index = _sheet.ConditionalFormattings.Add();
            // Get the formatted conditions
            FormatConditionCollection formatConditions = _sheet.ConditionalFormattings[index];
            // Get the cell area calling the custom GetCellAreaByName method
            CellArea area = GetCellAreaByName(cellAreaName);
            // Add the formatted conditions cell area.
            formatConditions.AddArea(area);
            // Call the custom FillCell method
            FillCell(cellAreaName, color);
            // Return the formatted conditions
            return formatConditions;
        }