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