In version 1 we have computeFireTimes which will returns a list of Dates that are the next fire times of a Trigger
Is there a way to do the same thing in version 2
In version 1 we have computeFireTimes which will returns a list of Dates that are the next fire times of a Trigger
Is there a way to do the same thing in version 2
Use GetNextFireTimeUtc and GetFireTimeAfter ,
eg
var dt = trigger.GetNextFireTimeUtc();
for (int i = 0; i < 10; i++)
{
if (dt == null)
break;
Console.WriteLine(dt.Value.ToLocalTime());
dt = trigger.GetFireTimeAfter(dt);
}
Another option:
var times = TriggerUtils.ComputeFireTimes(trigger as IOperableTrigger, null, 10);
foreach (var time in times) Debug.WriteLine(time.ToLocalTime());
This will return the next 10 fire times.