TLSharp/TeleSharp.TL/TL/TLMessageMediaDocument.cs
Andrzej Gołaszewski ca3a71e39a update to layer 71
code formatting
2017-12-20 12:06:31 +01:00

60 lines
1.4 KiB
C#

using System.IO;
namespace TeleSharp.TL
{
[TLObject(2084836563)]
public class TLMessageMediaDocument : TLAbsMessageMedia
{
public string Caption { get; set; }
public override int Constructor
{
get
{
return 2084836563;
}
}
public TLAbsDocument Document { get; set; }
public int Flags { get; set; }
public int? TtlSeconds { get; set; }
public void ComputeFlags()
{
}
public override void DeserializeBody(BinaryReader br)
{
Flags = br.ReadInt32();
if ((Flags & 1) != 0)
Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br);
else
Document = null;
if ((Flags & 2) != 0)
Caption = StringUtil.Deserialize(br);
else
Caption = null;
if ((Flags & 4) != 0)
TtlSeconds = br.ReadInt32();
else
TtlSeconds = null;
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
bw.Write(Flags);
if ((Flags & 1) != 0)
ObjectUtils.SerializeObject(Document, bw);
if ((Flags & 2) != 0)
StringUtil.Serialize(Caption, bw);
if ((Flags & 4) != 0)
bw.Write(TtlSeconds.Value);
}
}
}