public static GetLicensesResponse DeserializeLengthDelimited(Stream stream)
        {
            GetLicensesResponse getLicensesResponse = new GetLicensesResponse();

            GetLicensesResponse.DeserializeLengthDelimited(stream, getLicensesResponse);
            return(getLicensesResponse);
        }
        public static GetLicensesResponse DeserializeLengthDelimited(Stream stream, GetLicensesResponse instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GetLicensesResponse.Deserialize(stream, instance, num));
        }
 public static void Serialize(Stream stream, GetLicensesResponse instance)
 {
     if (instance.Licenses.Count > 0)
     {
         foreach (AccountLicense accountLicense in instance.Licenses)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, accountLicense.GetSerializedSize());
             AccountLicense.Serialize(stream, accountLicense);
         }
     }
 }
 public static void Serialize(Stream stream, GetLicensesResponse instance)
 {
     if (instance.Licenses.get_Count() > 0)
     {
         using (List <AccountLicense> .Enumerator enumerator = instance.Licenses.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 AccountLicense current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 AccountLicense.Serialize(stream, current);
             }
         }
     }
 }
Exemplo n.º 5
0
 public static GetLicensesResponse Deserialize(Stream stream, GetLicensesResponse instance, long limit)
 {
     if (instance.Licenses == null)
     {
         instance.Licenses = new List <AccountLicense>();
     }
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num == -1)
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
             else if (num == 10)
             {
                 instance.Licenses.Add(AccountLicense.DeserializeLengthDelimited(stream));
             }
             else
             {
                 Key key = ProtocolParser.ReadKey((byte)num, stream);
                 if (key.Field == 0)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static GetLicensesResponse Deserialize(Stream stream, GetLicensesResponse instance, long limit)
 {
     if (instance.Licenses == null)
     {
         instance.Licenses = new List <AccountLicense>();
     }
     while (limit < 0L || stream.get_Position() < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else
         {
             int num2 = num;
             if (num2 != 10)
             {
                 Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                 uint field = key.Field;
                 if (field == 0u)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
             else
             {
                 instance.Licenses.Add(AccountLicense.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public override bool Equals(object obj)
        {
            GetLicensesResponse getLicensesResponse = obj as GetLicensesResponse;

            if (getLicensesResponse == null)
            {
                return(false);
            }
            if (this.Licenses.Count != getLicensesResponse.Licenses.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Licenses.Count; i++)
            {
                if (!this.Licenses[i].Equals(getLicensesResponse.Licenses[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
        public override bool Equals(object obj)
        {
            GetLicensesResponse getLicensesResponse = obj as GetLicensesResponse;

            if (getLicensesResponse == null)
            {
                return(false);
            }
            if (this.Licenses.get_Count() != getLicensesResponse.Licenses.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.Licenses.get_Count(); i++)
            {
                if (!this.Licenses.get_Item(i).Equals(getLicensesResponse.Licenses.get_Item(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
 public void Deserialize(Stream stream)
 {
     GetLicensesResponse.Deserialize(stream, this);
 }
 public static GetLicensesResponse Deserialize(Stream stream, GetLicensesResponse instance)
 {
     return(GetLicensesResponse.Deserialize(stream, instance, -1L));
 }