Пример #1
0
        public static GetWalletListRequest DeserializeLengthDelimited(Stream stream)
        {
            GetWalletListRequest getWalletListRequest = new GetWalletListRequest();

            GetWalletListRequest.DeserializeLengthDelimited(stream, getWalletListRequest);
            return(getWalletListRequest);
        }
Пример #2
0
        public static GetWalletListRequest DeserializeLengthDelimited(Stream stream, GetWalletListRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GetWalletListRequest.Deserialize(stream, instance, num));
        }
Пример #3
0
 public static GetWalletListRequest Deserialize(Stream stream, GetWalletListRequest instance, long limit)
 {
     instance.Refresh = false;
     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)
             {
                 if (num == 16)
                 {
                     instance.Refresh = ProtocolParser.ReadBool(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 (instance.AccountId != null)
             {
                 bnet.protocol.account.AccountId.DeserializeLengthDelimited(stream, instance.AccountId);
             }
             else
             {
                 instance.AccountId = bnet.protocol.account.AccountId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Пример #4
0
 public static GetWalletListRequest Deserialize(Stream stream, GetWalletListRequest instance, long limit)
 {
     instance.Refresh = false;
     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)
             {
                 if (num2 != 16)
                 {
                     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.Refresh = ProtocolParser.ReadBool(stream);
                 }
             }
             else if (instance.AccountId == null)
             {
                 instance.AccountId = AccountId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountId.DeserializeLengthDelimited(stream, instance.AccountId);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Пример #5
0
 public static void Serialize(Stream stream, GetWalletListRequest instance)
 {
     if (instance.AccountId == null)
     {
         throw new ArgumentNullException("AccountId", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.AccountId.GetSerializedSize());
     AccountId.Serialize(stream, instance.AccountId);
     if (instance.HasRefresh)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteBool(stream, instance.Refresh);
     }
 }
Пример #6
0
        public override bool Equals(object obj)
        {
            GetWalletListRequest getWalletListRequest = obj as GetWalletListRequest;

            if (getWalletListRequest == null)
            {
                return(false);
            }
            if (!this.AccountId.Equals(getWalletListRequest.AccountId))
            {
                return(false);
            }
            if (this.HasRefresh == getWalletListRequest.HasRefresh && (!this.HasRefresh || this.Refresh.Equals(getWalletListRequest.Refresh)))
            {
                return(true);
            }
            return(false);
        }
Пример #7
0
 public static GetWalletListRequest Deserialize(Stream stream, GetWalletListRequest instance)
 {
     return(GetWalletListRequest.Deserialize(stream, instance, -1L));
 }
Пример #8
0
 public void Deserialize(Stream stream)
 {
     GetWalletListRequest.Deserialize(stream, this);
 }
Пример #9
0
        public override bool Equals(object obj)
        {
            GetWalletListRequest getWalletListRequest = obj as GetWalletListRequest;

            return(getWalletListRequest != null && this.AccountId.Equals(getWalletListRequest.AccountId) && this.HasRefresh == getWalletListRequest.HasRefresh && (!this.HasRefresh || this.Refresh.Equals(getWalletListRequest.Refresh)));
        }