public override bool Equals(object obj) { AccountStateNotification accountStateNotification = obj as AccountStateNotification; if (accountStateNotification == null) { return(false); } if (this.HasState != accountStateNotification.HasState || this.HasState && !this.State.Equals(accountStateNotification.State)) { return(false); } if (this.HasSubscriberId != accountStateNotification.HasSubscriberId || this.HasSubscriberId && !this.SubscriberId.Equals(accountStateNotification.SubscriberId)) { return(false); } if (this.HasAccountTags != accountStateNotification.HasAccountTags || this.HasAccountTags && !this.AccountTags.Equals(accountStateNotification.AccountTags)) { return(false); } if (this.HasSubscriptionCompleted == accountStateNotification.HasSubscriptionCompleted && (!this.HasSubscriptionCompleted || this.SubscriptionCompleted.Equals(accountStateNotification.SubscriptionCompleted))) { return(true); } return(false); }
public static void Serialize(Stream stream, AccountStateNotification instance) { if (instance.HasState) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.State.GetSerializedSize()); AccountState.Serialize(stream, instance.State); } if (instance.HasSubscriberId) { stream.WriteByte(16); ProtocolParser.WriteUInt64(stream, instance.SubscriberId); } if (instance.HasAccountTags) { stream.WriteByte(26); ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize()); AccountFieldTags.Serialize(stream, instance.AccountTags); } if (instance.HasSubscriptionCompleted) { stream.WriteByte(32); ProtocolParser.WriteBool(stream, instance.SubscriptionCompleted); } }
public static AccountStateNotification DeserializeLengthDelimited(Stream stream, AccountStateNotification instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(AccountStateNotification.Deserialize(stream, instance, position)); }
public static AccountStateNotification DeserializeLengthDelimited(Stream stream) { AccountStateNotification accountStateNotification = new AccountStateNotification(); AccountStateNotification.DeserializeLengthDelimited(stream, accountStateNotification); return(accountStateNotification); }
public static AccountStateNotification DeserializeLengthDelimited(Stream stream, AccountStateNotification instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(AccountStateNotification.Deserialize(stream, instance, num)); }
public static AccountStateNotification Deserialize(Stream stream, AccountStateNotification instance, long limit) { 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 (instance.State != null) { AccountState.DeserializeLengthDelimited(stream, instance.State); } else { instance.State = AccountState.DeserializeLengthDelimited(stream); } } else if (num == 16) { instance.SubscriberId = ProtocolParser.ReadUInt64(stream); } else if (num != 26) { if (num == 32) { instance.SubscriptionCompleted = 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.AccountTags != null) { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } else { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static AccountStateNotification Deserialize(Stream stream, AccountStateNotification instance) { return(AccountStateNotification.Deserialize(stream, instance, (long)-1)); }
public void Deserialize(Stream stream) { AccountStateNotification.Deserialize(stream, this); }
public override bool Equals(object obj) { AccountStateNotification accountStateNotification = obj as AccountStateNotification; return(accountStateNotification != null && this.HasState == accountStateNotification.HasState && (!this.HasState || this.State.Equals(accountStateNotification.State)) && this.HasSubscriberId == accountStateNotification.HasSubscriberId && (!this.HasSubscriberId || this.SubscriberId.Equals(accountStateNotification.SubscriberId)) && this.HasAccountTags == accountStateNotification.HasAccountTags && (!this.HasAccountTags || this.AccountTags.Equals(accountStateNotification.AccountTags)) && this.HasSubscriptionCompleted == accountStateNotification.HasSubscriptionCompleted && (!this.HasSubscriptionCompleted || this.SubscriptionCompleted.Equals(accountStateNotification.SubscriptionCompleted))); }
public static AccountStateNotification Deserialize(Stream stream, AccountStateNotification instance, long limit) { 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) { if (num2 != 26) { if (num2 != 32) { 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.SubscriptionCompleted = ProtocolParser.ReadBool(stream); } } else if (instance.AccountTags == null) { instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream); } else { AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags); } } else { instance.SubscriberId = ProtocolParser.ReadUInt64(stream); } } else if (instance.State == null) { instance.State = AccountState.DeserializeLengthDelimited(stream); } else { AccountState.DeserializeLengthDelimited(stream, instance.State); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }