2021-03-30 22:34:31 +04:00
|
|
|
|
using System;
|
|
|
|
|
|
2022-03-18 22:38:52 +04:00
|
|
|
|
namespace ToolsModule.Interfaces
|
2021-03-28 19:48:15 +04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Интерфейс установки зависмости между элементами
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IDependencyManager
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавление зависимости
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
/// <typeparam name="U"></typeparam>
|
|
|
|
|
void RegisterType<T, U>() where U : T;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавление зависимости
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
void RegisterType<T>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение класса со всеми зависмостями
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
T Resolve<T>();
|
2021-03-30 22:34:31 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение класса со всеми зависмостями
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="t"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
object Resolve(Type t);
|
2021-03-28 19:48:15 +04:00
|
|
|
|
}
|
|
|
|
|
}
|