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