示例#1
0
 protected override void zBuildDescription(StringBuilder sb)
 {
     sb.Append("every ");
     DescriptionUtils.BuildDescriptiveList(WeeklyRecurrence, sb);
     sb.Append(" ");
     base.zBuildDescription(sb);
 }
示例#2
0
 protected override void zBuildDescription(StringBuilder sb)
 {
     if (RepeatsDailyOnInterval)
     {
         sb.AppendFormat("repeating {0} between {1} and {2}",
                         DescriptionUtils.GetIntervalDescription(DailyRepetitionInterval),
                         DailyRepetitionStartTimeUtc.ToLocalTime().ToLongTimeString(),
                         DailyRepetitionEndTimeUtc.ToLocalTime().ToLongTimeString());
     }
     else
     {
         sb.AppendFormat("at {0}", StartTimeUtc.ToLocalTime().ToLongTimeString());
     }
 }
示例#3
0
        protected override void zBuildDescription(StringBuilder sb)
        {
            sb.Append("every ");
            if (MonthlyRecurrence.Count == 12)
            {
                sb.Append("month");
            }
            else
            {
                DescriptionUtils.BuildDescriptiveList(MonthlyRecurrence, sb);
            }

            sb.Append(" on ");
            if (MonthlyRecurrenceType == MonthlyRecurrenceType.OrdinalDays)
            {
                if ((OrdinalDays.Count == 31 && !OrdinalDays.Contains(-1)) || OrdinalDays.Count == 32)
                {
                    sb.Append("every day");
                }
                else
                {
                    sb.Append("the ");
                    DescriptionUtils.BuildDescriptiveList(OrdinalDays, sb, formatListItem: od =>
                    {
                        if (od == -1)
                        {
                            return("last day");
                        }
                        string dayStr = (od + 1).ToString();
                        return(String.Format("{0}{1}", dayStr,
                                             dayStr.EndsWith("1") && !dayStr.EndsWith("11") ? "st" :
                                             dayStr.EndsWith("2") && !dayStr.EndsWith("12") ? "nd" :
                                             dayStr.EndsWith("3") && !dayStr.EndsWith("13") ? "rd" : "th"));
                    });
                }
            }
            else
            {
                sb.Append("the ");
                DescriptionUtils.BuildDescriptiveList(WeekdayPositions, sb);
                sb.Append(" ");
                DescriptionUtils.BuildDescriptiveList(Weekdays, sb);
            }
            sb.Append(" of the month ");
            base.zBuildDescription(sb);
        }
示例#4
0
 protected override void zBuildDescription(StringBuilder sb)
 {
     sb.Append(DescriptionUtils.GetIntervalDescription(HourlyRecurrence));
 }