public static InvitationRemovedNotification DeserializeLengthDelimited(Stream stream)
        {
            InvitationRemovedNotification invitationRemovedNotification = new InvitationRemovedNotification();

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

            num += stream.Position;
            return(InvitationRemovedNotification.Deserialize(stream, instance, num));
        }
 public static InvitationRemovedNotification Deserialize(Stream stream, InvitationRemovedNotification 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 (num == 16)
                 {
                     instance.Reason = ProtocolParser.ReadUInt32(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.Invitation != null)
             {
                 bnet.protocol.invitation.Invitation.DeserializeLengthDelimited(stream, instance.Invitation);
             }
             else
             {
                 instance.Invitation = bnet.protocol.invitation.Invitation.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static InvitationRemovedNotification Deserialize(Stream stream, InvitationRemovedNotification 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)
                 {
                     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.Reason = ProtocolParser.ReadUInt32(stream);
                 }
             }
             else if (instance.Invitation == null)
             {
                 instance.Invitation = Invitation.DeserializeLengthDelimited(stream);
             }
             else
             {
                 Invitation.DeserializeLengthDelimited(stream, instance.Invitation);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static void Serialize(Stream stream, InvitationRemovedNotification instance)
 {
     if (instance.Invitation == null)
     {
         throw new ArgumentNullException("Invitation", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.Invitation.GetSerializedSize());
     Invitation.Serialize(stream, instance.Invitation);
     if (instance.HasReason)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt32(stream, instance.Reason);
     }
 }
        public override bool Equals(object obj)
        {
            InvitationRemovedNotification invitationRemovedNotification = obj as InvitationRemovedNotification;

            if (invitationRemovedNotification == null)
            {
                return(false);
            }
            if (!this.Invitation.Equals(invitationRemovedNotification.Invitation))
            {
                return(false);
            }
            if (this.HasReason == invitationRemovedNotification.HasReason && (!this.HasReason || this.Reason.Equals(invitationRemovedNotification.Reason)))
            {
                return(true);
            }
            return(false);
        }
 public static InvitationRemovedNotification Deserialize(Stream stream, InvitationRemovedNotification instance)
 {
     return(InvitationRemovedNotification.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     InvitationRemovedNotification.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            InvitationRemovedNotification invitationRemovedNotification = obj as InvitationRemovedNotification;

            return(invitationRemovedNotification != null && this.Invitation.Equals(invitationRemovedNotification.Invitation) && this.HasReason == invitationRemovedNotification.HasReason && (!this.HasReason || this.Reason.Equals(invitationRemovedNotification.Reason)));
        }