Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取消息历史容器实例
 /// </summary>
 /// <returns></returns>
 public static MessageHistoryContainer GetInstance()
 {
     if (inits == null)
     {
         inits = new MessageHistoryContainer();
     }
     return(inits);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 消息历史
 /// </summary>
 /// <returns></returns>
 public static IMessageHistoryContainer History()
 {
     return(MessageHistoryContainer.GetInstance());
 }