IScheduledTask.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. namespace MediaBrowser.Common.ScheduledTasks
  6. {
  7. /// <summary>
  8. /// Interface IScheduledTaskWorker
  9. /// </summary>
  10. public interface IScheduledTask
  11. {
  12. /// <summary>
  13. /// Gets the name of the task
  14. /// </summary>
  15. /// <value>The name.</value>
  16. string Name { get; }
  17. /// <summary>
  18. /// Gets the description.
  19. /// </summary>
  20. /// <value>The description.</value>
  21. string Description { get; }
  22. /// <summary>
  23. /// Gets the category.
  24. /// </summary>
  25. /// <value>The category.</value>
  26. string Category { get; }
  27. /// <summary>
  28. /// Executes the task
  29. /// </summary>
  30. /// <param name="cancellationToken">The cancellation token.</param>
  31. /// <param name="progress">The progress.</param>
  32. /// <returns>Task.</returns>
  33. Task Execute(CancellationToken cancellationToken, IProgress<double> progress);
  34. /// <summary>
  35. /// Gets the default triggers.
  36. /// </summary>
  37. /// <returns>IEnumerable{BaseTaskTrigger}.</returns>
  38. IEnumerable<ITaskTrigger> GetDefaultTriggers();
  39. }
  40. public interface IConfigurableScheduledTask
  41. {
  42. /// <summary>
  43. /// Gets a value indicating whether this instance is hidden.
  44. /// </summary>
  45. /// <value><c>true</c> if this instance is hidden; otherwise, <c>false</c>.</value>
  46. bool IsHidden { get; }
  47. /// <summary>
  48. /// Gets a value indicating whether this instance is enabled.
  49. /// </summary>
  50. /// <value><c>true</c> if this instance is enabled; otherwise, <c>false</c>.</value>
  51. bool IsEnabled { get; }
  52. }
  53. }