You can cancel a scheduled task in several ways.

  • To cancel the current run of a scheduled task, call ScheduledTask.RemoveScheduledTask. This method does not cancel subsequent runs of the ScheduledTask.
  • To cancel an upcoming run of a ScheduledTask, call ScheduledTask.ReconfigureScheduledTask with a new ScheduledTaskSpec data object containing the new specifications for the schedule.
  • To cancel a ScheduledTask that spawns a second task, create a PropertyCollector to obtain the reference to the Tasks and call its CancelTask method. The task must be cancellable.