//Called in RecurringForm when saving out public void GetOccuringDates() { OccuringDates.Clear(); DateTime timespan = this.Start; OccuringDates.Add(timespan.Date); int recurredcheck = 1; while (recurredcheck++ < AmountRecurring) { switch (this.Recursion) { case Recurring.Daily: timespan = timespan.AddDays(1); break; case Recurring.Weekly: timespan = timespan.AddDays(7); break; case Recurring.Monthly: timespan = timespan.AddMonths(1); break; case Recurring.Yearly: timespan = timespan.AddYears(1); break; } OccuringDates.Add(timespan.Date); } }
public override bool OccursOnDate(DateTime date) { return(OccuringDates.Contains(date.Date)); }