mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-14 03:30:25 +01:00
More DI
This commit is contained in:
@@ -6,7 +6,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Represents a task trigger that fires on a weekly basis
|
||||
/// </summary>
|
||||
public class WeeklyTrigger : BaseTaskTrigger
|
||||
public class WeeklyTrigger : ITaskTrigger
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the time of day to trigger the task to run
|
||||
@@ -30,7 +30,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// Stars waiting for the trigger action
|
||||
/// </summary>
|
||||
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
|
||||
protected internal override void Start(bool isApplicationStartup)
|
||||
public void Start(bool isApplicationStartup)
|
||||
{
|
||||
DisposeTimer();
|
||||
|
||||
@@ -69,25 +69,11 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Stops waiting for the trigger action
|
||||
/// </summary>
|
||||
protected internal override void Stop()
|
||||
public void Stop()
|
||||
{
|
||||
DisposeTimer();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes this instance.
|
||||
/// </summary>
|
||||
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
||||
protected override void Dispose(bool dispose)
|
||||
{
|
||||
if (dispose)
|
||||
{
|
||||
DisposeTimer();
|
||||
}
|
||||
|
||||
base.Dispose(dispose);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the timer.
|
||||
/// </summary>
|
||||
@@ -98,5 +84,21 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [triggered].
|
||||
/// </summary>
|
||||
public event EventHandler<EventArgs> Triggered;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [triggered].
|
||||
/// </summary>
|
||||
private void OnTriggered()
|
||||
{
|
||||
if (Triggered != null)
|
||||
{
|
||||
Triggered(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user