ITaskTrigger.cs 837 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using Microsoft.Extensions.Logging;
  3. namespace MediaBrowser.Model.Tasks
  4. {
  5. /// <summary>
  6. /// Interface ITaskTrigger
  7. /// </summary>
  8. public interface ITaskTrigger
  9. {
  10. /// <summary>
  11. /// Fires when the trigger condition is satisfied and the task should run
  12. /// </summary>
  13. event EventHandler<EventArgs> Triggered;
  14. /// <summary>
  15. /// Gets or sets the options of this task.
  16. /// </summary>
  17. TaskOptions TaskOptions { get; set; }
  18. /// <summary>
  19. /// Stars waiting for the trigger action
  20. /// </summary>
  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. }
  27. }