Aspose.Cells.Examples.CSharp.Formatting.ConditionalFormatting.AddTimePeriod_5 C# (CSharp) Метод

AddTimePeriod_5() приватный Метод

private AddTimePeriod_5 ( ) : void
Результат void
        private void AddTimePeriod_5()
        {
            FormatConditionCollection conds = GetFormatCondition("I9:K10", Color.Maroon);
            int idx = conds.AddCondition(FormatConditionType.TimePeriod);
            FormatCondition cond = conds[idx];
            cond.Style.BackgroundColor = Color.Pink;
            cond.Style.Pattern = BackgroundType.Solid;
            cond.TimePeriod = TimePeriodType.NextMonth;
            Cell c = _sheet.Cells["I9"];
            Style style = c.GetStyle();
            style.Number = 30;
            c.SetStyle(style);
            c.PutValue(DateTime.Parse("2008/08/25"));
            c = _sheet.Cells["K10"];
            c.PutValue(DateTime.Parse("2008/07/30"));
            style = c.GetStyle();
            style.Number = 30;
            c.SetStyle(style);
            c = _sheet.Cells["I10"];
            c.PutValue("NextMonth");
        }
        // This method implements the TimePeriod conditional formatting type with LastWeek attribute.