diff --git a/LAEPS/App.xaml.cs b/LAEPS/App.xaml.cs index b001676..cfaef7c 100644 --- a/LAEPS/App.xaml.cs +++ b/LAEPS/App.xaml.cs @@ -80,17 +80,5 @@ namespace LAEPS //指定模块加载方式为从文件夹中以反射发现并加载module(推荐用法) 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); - } } } diff --git a/MainModule/MainModule.cs b/MainModule/MainModule.cs index ebb7f4a..fb3b851 100644 --- a/MainModule/MainModule.cs +++ b/MainModule/MainModule.cs @@ -3,6 +3,7 @@ using System.Reflection; namespace MainModule { + [Module(OnDemand=true)] public class MainModule : IModule { public void OnInitialized(IContainerProvider containerProvider)