ITaskTrigger.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using MediaBrowser.Model.Events;
  2. using MediaBrowser.Model.Tasks;
  3. using System;
  4. namespace MediaBrowser.Common.ScheduledTasks
  5. {
  6. /// <summary>
  7. /// Interface ITaskTrigger
  8. /// </summary>
  9. public interface ITaskTrigger
  10. {
  11. /// <summary>
  12. /// Fires when the trigger condition is satisfied and the task should run
  13. /// </summary>
  14. event EventHandler<GenericEventArgs<TaskExecutionOptions>> Triggered;
  15. /// <summary>
  16. /// Stars waiting for the trigger action
  17. /// </summary>
  18. /// <param name="lastResult">The last result.</param>
  19. /// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
  20. void Start(TaskResult lastResult, bool isApplicationStartup);
  21. /// <summary>
  22. /// Stops waiting for the trigger action
  23. /// </summary>
  24. void Stop();
  25. /// <summary>
  26. /// Gets or sets the execution properties of this task.
  27. /// </summary>
  28. /// <value>
  29. /// The execution properties of this task.
  30. /// </value>
  31. TaskExecutionOptions TaskOptions { get; set; }
  32. }
  33. }