public void ParseSerializeData(CCCommunicateClass.Seria_BaseMessage obj)
        {
            base.ParseSerializeData(obj as CCCommunicateClass.Seria_ParamPackage);
            BaseMessageType tmpObj = new BaseMessageType();

            tmpObj.ParseSerializeData(obj.MessageType);
            this.mMessageType = tmpObj;
        }
Beispiel #2
0
 public void RegistMessage(BaseMessageType typMsg, Type t_Msg)
 {
     if ((null != typMsg) && (!mTypTable.ContainsKey(typMsg.Id)))
     {
         mTypTable.Add(typMsg.Id, t_Msg);
     }
     else
     {
         throw new InvalidOperationException("已经注册的消息类型: " + typMsg.Id);
     }
 }
Beispiel #3
0
 public BaseMessage CreateMessage(BaseMessageType typMsg)
 {
     if ((null != typMsg) && (mTypTable.ContainsKey(typMsg.Id)))
     {
         BaseMessage msg = Activator.CreateInstance(mTypTable[typMsg.Id] as Type) as BaseMessage;
         msg.Type = typMsg;
         return(msg);
     }
     else
     {
         throw new InvalidOperationException("未知的消息类型: " + typMsg.Id);
     }
 }
 public BaseMessage(BaseMessageType t_msg)
 {
     mMessageType = t_msg;
 }