Dynamically add days to DaysOfWeek

Topics: Examples
Mar 12, 2013 at 2:16 PM
My UI contains checkboxes of days, so when user setup a weekly schedule it should create a WeeklyTrigger with checked days , how to implement this case ?
Mar 12, 2013 at 4:41 PM
You will have to step through the checkboxes and assign each one to a DaysOfTheWeek value then OR all those selected values together and assign them to the DayOfWeek property of the WeeklyTrigger. If the task already exists, you will need to retrieve it, update the trigger and the re-register it. You can see an example of this in the WeeklyTriggerUI control at http://taskscheduler.codeplex.com/SourceControl/changeset/view/83275#1324283.