рефакторинг, переименование DependencyRegistration
This commit is contained in:
parent
cce896bf2b
commit
05d88ca8f1
@ -42,9 +42,9 @@ namespace ToolsModule.BusinessLogics
|
|||||||
/// Загрузка всех классов-реализаций IImplementationExtension
|
/// Загрузка всех классов-реализаций IImplementationExtension
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static List<IImplementationExtension> GetImplementationExtensions()
|
public static List<IDependencyRegistration> GetImplementationExtensions()
|
||||||
{
|
{
|
||||||
var list = new List<IImplementationExtension>();
|
var list = new List<IDependencyRegistration>();
|
||||||
if(Directory.Exists(_pathToImplementationExt))
|
if(Directory.Exists(_pathToImplementationExt))
|
||||||
{
|
{
|
||||||
var files = Directory.GetFiles(_pathToImplementationExt, "*.dll", SearchOption.AllDirectories);
|
var files = Directory.GetFiles(_pathToImplementationExt, "*.dll", SearchOption.AllDirectories);
|
||||||
@ -55,12 +55,12 @@ namespace ToolsModule.BusinessLogics
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Assembly asm = Assembly.LoadFrom(file);
|
var asm = Assembly.LoadFrom(file);
|
||||||
foreach (var t in asm.GetExportedTypes())
|
foreach (var t in asm.GetExportedTypes())
|
||||||
{
|
{
|
||||||
if (t.IsClass && typeof(IImplementationExtension).IsAssignableFrom(t))
|
if (t.IsClass && typeof(IDependencyRegistration).IsAssignableFrom(t))
|
||||||
{
|
{
|
||||||
list.Add((IImplementationExtension)Activator.CreateInstance(t));
|
list.Add((IDependencyRegistration)Activator.CreateInstance(t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadedFiles.Add(file.GetFileName());
|
loadedFiles.Add(file.GetFileName());
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Интерфейс для регистрации зависимостей в модулях
|
/// Интерфейс для регистрации зависимостей в модулях
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IImplementationExtension
|
public interface IDependencyRegistration
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Регистрация сервисов
|
/// Регистрация сервисов
|
@ -5,7 +5,7 @@ using ToolsModule.Interfaces;
|
|||||||
|
|
||||||
namespace DepartmentBusinessLogic
|
namespace DepartmentBusinessLogic
|
||||||
{
|
{
|
||||||
public class DepartmentLogicDependencyRegistration : IImplementationExtension
|
public class DepartmentLogicDependencyRegistration : IDependencyRegistration
|
||||||
{
|
{
|
||||||
public void RegisterServices()
|
public void RegisterServices()
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ using ToolsModule.Interfaces;
|
|||||||
|
|
||||||
namespace DepartmentDatabaseImplementation
|
namespace DepartmentDatabaseImplementation
|
||||||
{
|
{
|
||||||
public class DepartmentImplementationExtensions : IImplementationExtension
|
public class DepartmentImplementationDependencyRegistration : IDependencyRegistration
|
||||||
{
|
{
|
||||||
public void RegisterServices()
|
public void RegisterServices()
|
||||||
{
|
{
|
@ -7,7 +7,7 @@ using ToolsModule.Interfaces;
|
|||||||
|
|
||||||
namespace SecurityBusinessLogic
|
namespace SecurityBusinessLogic
|
||||||
{
|
{
|
||||||
public class SecurityLogicDependencyRegistration : IImplementationExtension
|
public class SecurityLogicDependencyRegistration : IDependencyRegistration
|
||||||
{
|
{
|
||||||
public void RegisterServices()
|
public void RegisterServices()
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ using ToolsModule.Interfaces;
|
|||||||
|
|
||||||
namespace SecurityDatabaseImplementation
|
namespace SecurityDatabaseImplementation
|
||||||
{
|
{
|
||||||
public class SecurityImplementationExtensions : IImplementationExtension
|
public class SecurityImplementationDependencyRegistration : IDependencyRegistration
|
||||||
{
|
{
|
||||||
public void RegisterServices()
|
public void RegisterServices()
|
||||||
{
|
{
|
Loading…
Reference in New Issue
Block a user