This project has moved and is read-only. For the latest updates, please go here.

Сreate DailyTrigger() runs everyday from specified time n times each n minutes.

May 27, 2011 at 11:39 AM

Hi, task explained in title of theme.

In another API it looks like this:

trigger = new DailyTrigger(startIntervalHours, startIntervalMinutes);
trigger.DurationMinutes = (endIntervalHours * 60 + endIntervalMinutes)
- (startIntervalHours * 60 + startIntervalMinutes);

After looking in previous posts I didn't find out how to do such by your's API.

How to create daily trigger that starts everyday at specified time is very simple:

var trigger = new DailyTrigger();
trigger.DaysInterval = 1;
trigger.StartBoundary = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, dailyHours, dailyMinutes, 0);

But previous task does me frustrate.

Thanks for help.

May 27, 2011 at 7:31 PM

I think this is what you are looking for:

DailyTrigger dt = new DailyTrigger(); // DaysInterval = 1 is default
dt.StartBoundary = DateTime.Today + new TimeSpan(dailyHours, dailyMinutes, 0);
dt.Repetition.Duration = TimeSpan.FromMinutes(minutesBetweenRuns * numberOfRuns);
dt.Repetition.Interval = TimeSpan.FromMinutes(minutesBetweenRuns);