public override DateTimeOffset? ComputeFirstFireTimeUtc(ICalendar calendar)
{
nextFireTimeUtc = GetFireTimeAfter(StartTimeUtc.AddSeconds(-1));
// Check calendar for date-time exclusion
while (nextFireTimeUtc != null && calendar != null
&& !calendar.IsTimeIncluded(nextFireTimeUtc.Value))
{
nextFireTimeUtc = GetFireTimeAfter(nextFireTimeUtc);
if (nextFireTimeUtc == null)
{
break;
}
//avoid infinite loop
if (nextFireTimeUtc.Value.Year > YearToGiveupSchedulingAt)
{
return null;
}
}
return nextFireTimeUtc;
}