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