Пример #1
0
        internal override List <ComponentLine> BuildLines()
        {
            List <ComponentLine> lines = new List <ComponentLine>
            {
                new ComponentLine("DTSTAMP:", DateTime.Now, true),
                new ComponentLine("SEQUENCE:", Sequence),
                new ComponentLine("UID:", $"{Code}@icalendar-API"),
                new ComponentLine("TRIGGER:", TriggerDate, true),
                new ComponentLine("ACTION:", ActionType),
                new ComponentLine("REPEAT:", MathExt.Max <int>(Repeat, 1)),
                new ComponentLine("DURATION:", Duration.ToString()),
                new ComponentLine("DUE:", DueDate, true),
                new ComponentLine("PERCENT-COMPLETE:", PercentageComplete.ForceToRange(0, 100)),
                new ComponentLine("PRIORITY:", Priority.ForceToRange(0, 9)),
                new ComponentLine("COMPLETED:", Completed.Coalesce(DateTime.Today.AddDays(1)), true)
            };

            lines.AddRange(Attachments.Select(a => a.BuildLine()));

            return(BuildComponent(lines));
        }