From 362e509be1839a2a6804ad10f0b48be2bfe0e0b5 Mon Sep 17 00:00:00 2001 From: hsc Date: Thu, 15 Jan 2026 11:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=9C=80=E5=8A=A0=E8=BD=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LAEPS/App.xaml.cs | 12 ------------ MainModule/MainModule.cs | 1 + 2 files changed, 1 insertion(+), 12 deletions(-) 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)