public static void Serialize(Stream stream, IncrementChannelCountRequest instance) { if (instance.AgentId == null) { throw new ArgumentNullException("AgentId", "Required by proto specification."); } stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize()); EntityId.Serialize(stream, instance.AgentId); if (instance.Descriptions.Count > 0) { foreach (ChannelCountDescription description in instance.Descriptions) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, description.GetSerializedSize()); ChannelCountDescription.Serialize(stream, description); } } }
public static void Serialize(Stream stream, IncrementChannelCountRequest instance) { if (instance.AgentId == null) { throw new ArgumentNullException("AgentId", "Required by proto specification."); } stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize()); EntityId.Serialize(stream, instance.AgentId); if (instance.Descriptions.get_Count() > 0) { using (List <ChannelCountDescription> .Enumerator enumerator = instance.Descriptions.GetEnumerator()) { while (enumerator.MoveNext()) { ChannelCountDescription current = enumerator.get_Current(); stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); ChannelCountDescription.Serialize(stream, current); } } } }
public void Serialize(Stream stream) { ChannelCountDescription.Serialize(stream, this); }