public static void Serialize(Stream stream, ConnectionMeteringContentHandles instance) { if (instance.ContentHandle.get_Count() > 0) { using (List <ContentHandle> .Enumerator enumerator = instance.ContentHandle.GetEnumerator()) { while (enumerator.MoveNext()) { ContentHandle current = enumerator.get_Current(); stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); bnet.protocol.ContentHandle.Serialize(stream, current); } } } }
public uint GetSerializedSize() { uint num = 0u; if (this.ContentHandle.get_Count() > 0) { using (List <ContentHandle> .Enumerator enumerator = this.ContentHandle.GetEnumerator()) { while (enumerator.MoveNext()) { ContentHandle current = enumerator.get_Current(); num += 1u; uint serializedSize = current.GetSerializedSize(); num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize); } } } return(num); }