Files

56 lines
2.6 KiB
C#
Raw Permalink Normal View History

using Cowain.Bake.Common.Interface;
using Prism.Ioc;
using Prism.Modularity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cowain.Bake.BLL
{
public class BLLModule : IModule
{
public void OnInitialized(IContainerProvider containerProvider) //IUnityContainer
{
// 将容器实例注册为单例
MyAppContainer.Current = containerProvider;
//containerProvider.Resolve<MemoryDataProvider>();
//
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterSingleton<BLL.AlarmContentService>();
containerRegistry.RegisterSingleton<BLL.AlarmService>();
containerRegistry.RegisterSingleton<BLL.BatteryInfoService>();
containerRegistry.RegisterSingleton<BLL.BatteryNGService>();
containerRegistry.RegisterSingleton<BLL.CavityInfoService>();
containerRegistry.RegisterSingleton<BLL.MesDataService>();
containerRegistry.RegisterSingleton<BLL.CavityInfoService>();
containerRegistry.RegisterSingleton<BLL.DeviceConfigService>();
containerRegistry.RegisterSingleton<BLL.ElectricEnergyService>();
containerRegistry.RegisterSingleton<BLL.LogService>();
//containerRegistry.RegisterSingleton<BLL.MemoryDataProvider>(); //IMemoryDataProvider
containerRegistry.RegisterSingleton<BLL.MenuInfoService>();
containerRegistry.RegisterSingleton<BLL.PalletInfoService>();
containerRegistry.RegisterSingleton<BLL.ProcessParamService>();
containerRegistry.RegisterSingleton<BLL.ProductionInformationService>();
containerRegistry.RegisterSingleton<BLL.RoleInfoService>();
containerRegistry.RegisterSingleton<BLL.StationService>();
containerRegistry.RegisterSingleton<BLL.SysSetupService>();
containerRegistry.RegisterSingleton<BLL.StoveSctualPatrolService>();
containerRegistry.RegisterSingleton<BLL.TagListService>();
containerRegistry.RegisterSingleton<BLL.TaskRecordService>();
containerRegistry.RegisterSingleton<BLL.TaskStepService>();
containerRegistry.RegisterSingleton<BLL.TaskTypeService>();
containerRegistry.RegisterSingleton<BLL.UserService>();
}
}
// 定义一个静态类用于保存全局的IUnityContainer实例
public static class MyAppContainer
{
public static IContainerProvider Current { get; set; }
}
}