TLSharp/TeleSharp.TL/TL/TLDocument.cs

67 lines
1.8 KiB
C#
Raw Normal View History

2016-09-24 15:38:26 +02:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TeleSharp.TL;
namespace TeleSharp.TL
{
[TLObject(-2027738169)]
2016-09-24 15:38:26 +02:00
public class TLDocument : TLAbsDocument
{
public override int Constructor
{
get
{
2016-10-13 19:33:16 +02:00
return -2027738169;
2016-09-24 15:38:26 +02:00
}
}
public long Id { get; set; }
public long AccessHash { get; set; }
public int Date { get; set; }
public string MimeType { get; set; }
public int Size { get; set; }
public TLAbsPhotoSize Thumb { get; set; }
public int DcId { get; set; }
public int Version { get; set; }
public TLVector<TLAbsDocumentAttribute> Attributes { 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)
{
Id = br.ReadInt64();
AccessHash = br.ReadInt64();
Date = br.ReadInt32();
MimeType = StringUtil.Deserialize(br);
Size = br.ReadInt32();
Thumb = (TLAbsPhotoSize)ObjectUtils.DeserializeObject(br);
DcId = br.ReadInt32();
Version = br.ReadInt32();
Attributes = (TLVector<TLAbsDocumentAttribute>)ObjectUtils.DeserializeVector<TLAbsDocumentAttribute>(br);
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
bw.Write(Id);
bw.Write(AccessHash);
bw.Write(Date);
StringUtil.Serialize(MimeType, bw);
bw.Write(Size);
ObjectUtils.SerializeObject(Thumb, bw);
bw.Write(DcId);
bw.Write(Version);
ObjectUtils.SerializeObject(Attributes, bw);
2016-09-24 15:38:26 +02:00
}
}
}