mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-09 08:34:16 -04:00
24 lines
595 B
C#
24 lines
595 B
C#
using Kyoo.Controllers;
|
|
using Unity;
|
|
|
|
namespace Kyoo
|
|
{
|
|
/// <summary>
|
|
/// A static class with helper functions to setup external modules
|
|
/// </summary>
|
|
public static class Module
|
|
{
|
|
/// <summary>
|
|
/// Register a new task to the container.
|
|
/// </summary>
|
|
/// <param name="services">The container</param>
|
|
/// <typeparam name="T">The type of the task</typeparam>
|
|
/// <returns>The initial container.</returns>
|
|
public static IUnityContainer AddTask<T>(this IUnityContainer services)
|
|
where T : class, ITask
|
|
{
|
|
services.RegisterSingleton<ITask, T>();
|
|
return services;
|
|
}
|
|
}
|
|
} |