Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

Commented Unassigned: Separate out scheduler UI into user control [12115]

$
0
0
The UI for configuring the schedule of a task (once/daily/weekly/monthly) is very nice. I'd like it to be a user control, please. That way I could use it in a simpler interface, that is without the advanced settings.

![Image](https://www.codeplex.com/Download/AttachmentDownload.ashx?ProjectName=taskscheduler&WorkItemId=12115&FileAttachmentId=3988)

Proposed patch follows.
Comments: ** Comment from web user: iainiainiain **

Most of this patch is pretty boring. It's mainly a copy paste job of some code from TriggerEditDialog into a new public user control, ScheduledTriggerUI. Then the dialog is made to use the new control. I've made sure that the layout and translations survived this copy-pasting.

There's only one nontrivial thing. The DailyTriggerUI and WeeklyTriggerUI, etc, controls mutate the triggers they are given. These controls are used by the new ScheduledTriggerUI control. However, ScheduledTriggerUI control should instead take a copy of the trigger it's given, similar to TriggerEditDialog. The reason is that ScheduledTriggerUI has to instantiate new triggers when changing between daily and weekly, etc, so it can't always mutate the trigger it was given.

Becaused ScheduledTriggerUI doesn't mutate the trigger it was given, the TriggerEditDialog needs to merge two triggers. Namely, the schedule (when a scheduled trigger) needs to come from ScheduledTriggerUI.Trigger, and as before the advanced properties need to come from TriggerEditDialog.trigger. This explains the modifications to TriggerEditDialog.Trigger.get, plus the creation of two helper functions, TriggerEditDialog.TriggerMergeSchedule() and Trigger.CopyBaseClassProperties().

Hopefully that makes sense.


Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>