/// <summary> /// 初始化 /// </summary> static async Task <bool> Init() { var cmdParse = new CmdParseService("HmiPro", GlobalConfig.StartupArgs.HmiProPath); UnityIocService.RegisterGlobalDepend(cmdParse); UnityIocService.RegisterGlobalDepend <HttpParse>(); UnityIocService.RegisterGlobalDepend <AsylumService>(); UnityIocService.ResolveDepend <AsylumService>().Init(); if (!await UnityIocService.ResolveDepend <HttpParse>().Start("http://+:9988/")) { Logger.Error("Http 服务启动失败"); return(false); } var pipeService = new PipeService("Asylum"); UnityIocService.RegisterGlobalDepend(pipeService); return(pipeService.Start()); }
public static void Init() { UnityIocService.AssertIsFirstInject(typeof(ReduxIoc)); //== 注入 redux 相关数据 var reducer = new CompositeReducer <AppState>() .Part(s => s.CpmState, CpmReducer.Create()) .Part(s => s.SysState, SysReducer.Create()) .Part(s => s.MqState, MqReducer.Create()) .Part(s => s.AlarmState, AlarmReducer.Create()) .Part(s => s.OeeState, OeeReducer.Create()) .Part(s => s.DMesState, DMesReducer.Create()) .Part(s => s.ViewStoreState, ViewStoreReducer.Create()) .Part(s => s.DpmStore, DpmReducer.Create()); var storePro = new StorePro <AppState>(reducer); //== 设置依赖注入 UnityIocService.RegisterGlobalDepend(storePro); UnityIocService.RegisterGlobalDepend <CpmCore>(); UnityIocService.RegisterGlobalDepend <CpmEffects>(); UnityIocService.RegisterGlobalDepend <SysService>(); UnityIocService.RegisterGlobalDepend <SysEffects>(); UnityIocService.RegisterGlobalDepend <MqService>(); UnityIocService.RegisterGlobalDepend <MqEffects>(); UnityIocService.RegisterGlobalDepend <MockEffects>(); UnityIocService.RegisterGlobalDepend <DbEffects>(); UnityIocService.RegisterGlobalDepend <DMesCore>(); UnityIocService.RegisterGlobalDepend <SchCore>(); UnityIocService.RegisterGlobalDepend <OeeCore>(); UnityIocService.RegisterGlobalDepend <AlarmCore>(); UnityIocService.RegisterGlobalDepend <ViewStoreCore>(); UnityIocService.RegisterGlobalDepend <DpmCore>(); UnityIocService.RegisterGlobalDepend <PipeEffects>(); UnityIocService.RegisterGlobalDepend <LoadEffects>(); UnityIocService.RegisterGlobalDepend <HookCore>(); }