/// <summary> /// 初始化消息处理机构 添加支撑类库内置的日志系统消息处理器 /// </summary> protected static void SetMessageBus() { //IMessageBus msgbus = MessageFactory.GetMegBus(); // 异常处理 调试处理 IProcessor error = new ProcessExceptionLog(MachineLog.GetLogger()); msgbus.AddProcessor(error); //调试处理 IProcessor dbug = new ProcessDebugLog(MachineLog.GetLogger()); msgbus.AddProcessor(dbug); ////Pt调试处理 //IProcessor ptdbug = new ProcessPtDebug(MachineLog.GetLogger()); //msgbus.AddProcessor(ptdbug); ////警告提示处理 //IProcessor remind = new ProcessWarning(); //msgbus.AddProcessor(remind); //系统内部消息处理 IProcessor sysinfo = new ProcessSysInfo(MachineLog.GetLogger()); msgbus.AddProcessor(sysinfo); //历史记录 IProcessor history = MessageHistoryContainer.GetInstance(); msgbus.AddProcessor(history); ////普通提示消息处理 //IProcessor noteinfo = new ProcessNote(); //msgbus.AddProcessor(noteinfo); }
/// <summary> /// 获取消息历史容器实例 /// </summary> /// <returns></returns> public static MessageHistoryContainer GetInstance() { if (inits == null) { inits = new MessageHistoryContainer(); } return(inits); }
/// <summary> /// 消息历史 /// </summary> /// <returns></returns> public static IMessageHistoryContainer History() { return(MessageHistoryContainer.GetInstance()); }