TLSharp/TeleSharp.TL/TL/TLInputMediaDocument.cs

50 lines
1.2 KiB
C#
Raw Normal View History

2016-09-24 15:38:26 +02:00
using System.IO;
2017-12-20 12:06:31 +01:00
2016-09-24 15:38:26 +02:00
namespace TeleSharp.TL
{
2017-12-20 12:06:31 +01:00
[TLObject(1523279502)]
2016-09-24 15:38:26 +02:00
public class TLInputMediaDocument : TLAbsInputMedia
{
2017-12-20 12:06:31 +01:00
public string Caption { get; set; }
2016-09-24 15:38:26 +02:00
public override int Constructor
{
get
{
2017-12-20 12:06:31 +01:00
return 1523279502;
2016-09-24 15:38:26 +02:00
}
}
2017-12-20 12:06:31 +01:00
public int Flags { get; set; }
public TLAbsInputDocument Id { get; set; }
2016-09-24 15:38:26 +02:00
2017-12-20 12:06:31 +01:00
public int? TtlSeconds { get; set; }
2016-09-24 15:38:26 +02:00
public void ComputeFlags()
{
}
2016-09-24 15:38:26 +02:00
public override void DeserializeBody(BinaryReader br)
{
2017-12-20 12:06:31 +01:00
Flags = br.ReadInt32();
Id = (TLAbsInputDocument)ObjectUtils.DeserializeObject(br);
Caption = StringUtil.Deserialize(br);
2017-12-20 12:06:31 +01:00
if ((Flags & 1) != 0)
TtlSeconds = br.ReadInt32();
else
TtlSeconds = null;
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
2017-12-20 12:06:31 +01:00
bw.Write(Flags);
ObjectUtils.SerializeObject(Id, bw);
StringUtil.Serialize(Caption, bw);
2017-12-20 12:06:31 +01:00
if ((Flags & 1) != 0)
bw.Write(TtlSeconds.Value);
2016-09-24 15:38:26 +02:00
}
}
}