/// <summary> /// 组件模块初始化 /// </summary> /// <param name="assembly"></param> private void ModuleInitialize(Assembly assembly) { Type componentModuleType = assembly.GetTypes().Where(m => typeof(IComponentModule).IsAssignableFrom(m)).FirstOrDefault(); if (componentModuleType.IsNotNull() && !componentModuleType.IsInterface) { IComponentModule componentModule = (IComponentModule)Activator.CreateInstance(componentModuleType); componentModule.AssemblyInitialize(); } }
/// <summary> /// 模块初始化注册信息 /// </summary> public void RegisterInitialize() { assemblyList.ForEach(assemblyItem => { Type componentModuleType = assemblyItem.GetTypes().Where(m => typeof(IComponentModule).IsAssignableFrom(m)).FirstOrDefault(); if (componentModuleType.IsNotNull() && !componentModuleType.IsInterface) { IComponentModule componentModule = (IComponentModule)Activator.CreateInstance(componentModuleType); componentModule.RegisterInitialize(); } }); }