//初始数据检查对象 public bool InitMsgHandle(Type dest_ClassType) { string setting = ""; var instance = this.CreateMsgHandle(dest_ClassType, setting); MsgHandle pMsgHandle = (MsgHandle)instance; if (pMsgHandle != null) { this.InitMsgHandle(pMsgHandle.Tag, pMsgHandle); } return(true); }
/// <summary>初始消息处理对象 /// </summary> /// <param name="tagName">标识名称</param> /// <param name="msgHandle">消息处理对象</param> /// <param name="isCanCover">是否直接覆盖</param> /// <returns></returns> public virtual bool InitMsgHandle(string tagName, MsgHandle msgHandle, bool isCanCover = false) { bool bResult = false; if (isCanCover) { _MsgHandles[tagName] = msgHandle; bResult = true; } else { //不存在时添加 if (!_MsgHandles.ContainsKey(tagName)) { _MsgHandles.Add(tagName, msgHandle); bResult = true; } } return(bResult); }