ITaskTrigger.cs 1.2 KB

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