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);
                    }
                }
            }
        }