public static void Serialize(Stream stream, BindRequest instance) { BinaryWriter binaryWriter = new BinaryWriter(stream); if (instance.ImportedServiceHash.get_Count() > 0) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, (uint)(4 * instance.ImportedServiceHash.get_Count())); using (List <uint> .Enumerator enumerator = instance.ImportedServiceHash.GetEnumerator()) { while (enumerator.MoveNext()) { uint current = enumerator.get_Current(); binaryWriter.Write(current); } } } if (instance.ExportedService.get_Count() > 0) { using (List <BoundService> .Enumerator enumerator2 = instance.ExportedService.GetEnumerator()) { while (enumerator2.MoveNext()) { BoundService current2 = enumerator2.get_Current(); stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize()); BoundService.Serialize(stream, current2); } } } }
public static void Serialize(Stream stream, BindRequest instance) { BinaryWriter binaryWriter = new BinaryWriter(stream); if (instance.ImportedServiceHash.Count > 0) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, (uint)(4 * instance.ImportedServiceHash.Count)); foreach (uint value in instance.ImportedServiceHash) { binaryWriter.Write(value); } } if (instance.ExportedService.Count > 0) { foreach (BoundService boundService in instance.ExportedService) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, boundService.GetSerializedSize()); BoundService.Serialize(stream, boundService); } } }
public void Serialize(Stream stream) { BoundService.Serialize(stream, this); }