按需加载优化
This commit is contained in:
@@ -80,17 +80,5 @@ namespace LAEPS
|
|||||||
//指定模块加载方式为从文件夹中以反射发现并加载module(推荐用法)
|
//指定模块加载方式为从文件夹中以反射发现并加载module(推荐用法)
|
||||||
return new DirectoryModuleCatalog() { ModulePath = @".\Modules" };
|
return new DirectoryModuleCatalog() { ModulePath = @".\Modules" };
|
||||||
}
|
}
|
||||||
//手动模块加载方式
|
|
||||||
protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
|
|
||||||
{
|
|
||||||
Type moduleAType = typeof(MainModule.MainModule);
|
|
||||||
moduleCatalog.AddModule(new ModuleInfo()
|
|
||||||
{
|
|
||||||
ModuleName = moduleAType.Name,
|
|
||||||
ModuleType = moduleAType.AssemblyQualifiedName,
|
|
||||||
InitializationMode = InitializationMode.OnDemand
|
|
||||||
});
|
|
||||||
base.ConfigureModuleCatalog(moduleCatalog);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Reflection;
|
|||||||
|
|
||||||
namespace MainModule
|
namespace MainModule
|
||||||
{
|
{
|
||||||
|
[Module(OnDemand=true)]
|
||||||
public class MainModule : IModule
|
public class MainModule : IModule
|
||||||
{
|
{
|
||||||
public void OnInitialized(IContainerProvider containerProvider)
|
public void OnInitialized(IContainerProvider containerProvider)
|
||||||
|
|||||||
Reference in New Issue
Block a user