2014-12-07 16:16:29 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Scheduling
|
|
|
|
|
|
{
|
2016-09-23 16:42:42 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Provides arguments for task runner events.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <typeparam name="T">The type of the task.</typeparam>
|
|
|
|
|
|
public class TaskEventArgs<T> : EventArgs
|
2014-12-07 16:16:29 +01:00
|
|
|
|
where T : IBackgroundTask
|
|
|
|
|
|
{
|
2016-09-23 16:42:42 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="TaskEventArgs{T}"/> class with a task.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="task">The task.</param>
|
2014-12-07 16:16:29 +01:00
|
|
|
|
public TaskEventArgs(T task)
|
|
|
|
|
|
{
|
|
|
|
|
|
Task = task;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-09-23 16:42:42 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="TaskEventArgs{T}"/> class with a task and an exception.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="task">The task.</param>
|
|
|
|
|
|
/// <param name="exception">An exception.</param>
|
2014-12-07 16:16:29 +01:00
|
|
|
|
public TaskEventArgs(T task, Exception exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
Task = task;
|
|
|
|
|
|
Exception = exception;
|
|
|
|
|
|
}
|
2016-09-23 16:42:42 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the task.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public T Task { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the exception.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Exception Exception { get; private set; }
|
2014-12-07 16:16:29 +01:00
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|