mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-27 01:50:53 +01:00
More DI
This commit is contained in:
@@ -6,7 +6,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Represents a task trigger that runs repeatedly on an interval
|
||||
/// </summary>
|
||||
public class IntervalTrigger : BaseTaskTrigger
|
||||
public class IntervalTrigger : ITaskTrigger
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the interval.
|
||||
@@ -24,7 +24,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();
|
||||
|
||||
@@ -34,25 +34,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>
|
||||
@@ -63,5 +49,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