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

How to determine if a task is OneTime task or not?

Nov 8, 2012 at 9:18 PM

Which property or method of Task class identifies a OneTime task? 

Nov 9, 2012 at 3:59 AM

Add a single TimeTrigger to the task definition.

Nov 9, 2012 at 4:32 PM


When i created a one time task with TimeTrigger and retrieved the information, the NextRun has 12/31/1899 12:00:00 AM. Can i check for presence of this value in the NextRun to identify a task as OneTime execution? Is there a better way to do the check?


Nov 10, 2012 at 2:45 AM

That would be correct. The task has already exectuted unless you specified a StartBoundary in the future for the specific time you want it to run:

new TimeTrigger(new DateTime(2012, 12, 31, 13, 0, 0, 0))

The above would produce a task who's next run time should be Dec 31, 2012 at 1pm.