public static RemoveNotification DeserializeLengthDelimited(Stream stream, RemoveNotification instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(RemoveNotification.Deserialize(stream, instance, position)); }
public static RemoveNotification DeserializeLengthDelimited(Stream stream) { RemoveNotification removeNotification = new RemoveNotification(); RemoveNotification.DeserializeLengthDelimited(stream, removeNotification); return(removeNotification); }
public static RemoveNotification Deserialize(Stream stream, RemoveNotification 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 != 18) { if (num2 != 24) { 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.MemberId == null) { instance.MemberId = EntityId.DeserializeLengthDelimited(stream); } else { EntityId.DeserializeLengthDelimited(stream, instance.MemberId); } } else if (instance.AgentId == null) { instance.AgentId = EntityId.DeserializeLengthDelimited(stream); } else { EntityId.DeserializeLengthDelimited(stream, instance.AgentId); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static RemoveNotification DeserializeLengthDelimited(Stream stream, RemoveNotification instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(RemoveNotification.Deserialize(stream, instance, num)); }
public static void Serialize(Stream stream, RemoveNotification instance) { if (instance.HasAgentId) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize()); EntityId.Serialize(stream, instance.AgentId); } if (instance.MemberId == null) { throw new ArgumentNullException("MemberId", "Required by proto specification."); } stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, instance.MemberId.GetSerializedSize()); EntityId.Serialize(stream, instance.MemberId); if (instance.HasReason) { stream.WriteByte(24); ProtocolParser.WriteUInt32(stream, instance.Reason); } }
public override bool Equals(object obj) { RemoveNotification removeNotification = obj as RemoveNotification; if (removeNotification == null) { return(false); } if (this.HasAgentId != removeNotification.HasAgentId || this.HasAgentId && !this.AgentId.Equals(removeNotification.AgentId)) { return(false); } if (!this.MemberId.Equals(removeNotification.MemberId)) { return(false); } if (this.HasReason == removeNotification.HasReason && (!this.HasReason || this.Reason.Equals(removeNotification.Reason))) { return(true); } return(false); }
public static RemoveNotification Deserialize(Stream stream, RemoveNotification 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.AgentId != null) { EntityId.DeserializeLengthDelimited(stream, instance.AgentId); } else { instance.AgentId = EntityId.DeserializeLengthDelimited(stream); } } else if (num != 18) { if (num == 24) { 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.MemberId != null) { EntityId.DeserializeLengthDelimited(stream, instance.MemberId); } else { instance.MemberId = EntityId.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static RemoveNotification Deserialize(Stream stream, RemoveNotification instance) { return(RemoveNotification.Deserialize(stream, instance, (long)-1)); }
public void Deserialize(Stream stream) { RemoveNotification.Deserialize(stream, this); }
public override bool Equals(object obj) { RemoveNotification removeNotification = obj as RemoveNotification; return(removeNotification != null && this.HasAgentId == removeNotification.HasAgentId && (!this.HasAgentId || this.AgentId.Equals(removeNotification.AgentId)) && this.MemberId.Equals(removeNotification.MemberId) && this.HasReason == removeNotification.HasReason && (!this.HasReason || this.Reason.Equals(removeNotification.Reason))); }