Files
Umbraco-CMS/tests/Umbraco.Tests/LegacyXmlPublishedCache/LegacyBackgroundTask/TaskEventArgs.cs
Paul Johnson 00133e880d Move test projects from src/ to tests/ (#11357)
* Update gitignore

* Move csproj

* Update project references

* Update solutions

* Update build scripts

* Tests used to share editorconfig with projects in src

* Fix broken tests.

* Stop copying around .editorconfig

merged root one with linting

* csharp_style_expression_bodied -> suggestion

* Move StyleCop rulesets to matching directories and update shared build properties

* Remove legacy build files, update NuGet.cofig and solution files

* Restore myget source

* Clean up .gitignore

* Update .gitignore

* Move new test classes to tests after merge

* Gitignore + nuget config

* Move new test

Co-authored-by: Ronald Barendse <ronald@barend.se>
2021-10-18 08:14:04 +01:00

43 lines
1.2 KiB
C#

using System;
namespace Umbraco.Web.Scheduling
{
/// <summary>
/// Provides arguments for task runner events.
/// </summary>
/// <typeparam name="T">The type of the task.</typeparam>
public class TaskEventArgs<T> : EventArgs
where T : IBackgroundTask
{
/// <summary>
/// Initializes a new instance of the <see cref="TaskEventArgs{T}"/> class with a task.
/// </summary>
/// <param name="task">The task.</param>
public TaskEventArgs(T task)
{
Task = task;
}
/// <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>
public TaskEventArgs(T task, Exception exception)
{
Task = task;
Exception = exception;
}
/// <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; }
}
}