//Protobuffer从MemoryStream进行反序列化 public bool FromMemoryStream(MemoryStream protoMS) { CapsuleRpcExchangeReply pb = ProtoBuf.Serializer.Deserialize <CapsuleRpcExchangeReply>(protoMS); FromPB(pb); return(true); }
//从Protobuffer类型初始化 public void FromPB(CapsuleRpcExchangeReply v) { if (v == null) { return; } m_Result = v.Result; m_ItemId = v.ItemId; }
//转化成Protobuffer类型函数 public CapsuleRpcExchangeReply ToPB() { CapsuleRpcExchangeReply v = new CapsuleRpcExchangeReply(); v.Result = m_Result; v.ItemId = m_ItemId; return(v); }