예제 #1
0
 public override void SerializeBody(BinaryWriter bw)
 {
     bw.Write(Constructor);
     StringUtil.Serialize(Email, bw);
 }
예제 #2
0
 public override void DeserializeBody(BinaryReader br)
 {
     Email = StringUtil.Deserialize(br);
 }
예제 #3
0
        public override void DeserializeBody(BinaryReader br)
        {
            Flags      = br.ReadInt32();
            Id         = br.ReadInt64();
            Url        = StringUtil.Deserialize(br);
            DisplayUrl = StringUtil.Deserialize(br);
            Hash       = br.ReadInt32();
            if ((Flags & 1) != 0)
            {
                Type = StringUtil.Deserialize(br);
            }
            else
            {
                Type = null;
            }

            if ((Flags & 2) != 0)
            {
                SiteName = StringUtil.Deserialize(br);
            }
            else
            {
                SiteName = null;
            }

            if ((Flags & 4) != 0)
            {
                Title = StringUtil.Deserialize(br);
            }
            else
            {
                Title = null;
            }

            if ((Flags & 8) != 0)
            {
                Description = StringUtil.Deserialize(br);
            }
            else
            {
                Description = null;
            }

            if ((Flags & 16) != 0)
            {
                Photo = (TLAbsPhoto)ObjectUtils.DeserializeObject(br);
            }
            else
            {
                Photo = null;
            }

            if ((Flags & 32) != 0)
            {
                EmbedUrl = StringUtil.Deserialize(br);
            }
            else
            {
                EmbedUrl = null;
            }

            if ((Flags & 32) != 0)
            {
                EmbedType = StringUtil.Deserialize(br);
            }
            else
            {
                EmbedType = null;
            }

            if ((Flags & 64) != 0)
            {
                EmbedWidth = br.ReadInt32();
            }
            else
            {
                EmbedWidth = null;
            }

            if ((Flags & 64) != 0)
            {
                EmbedHeight = br.ReadInt32();
            }
            else
            {
                EmbedHeight = null;
            }

            if ((Flags & 128) != 0)
            {
                Duration = br.ReadInt32();
            }
            else
            {
                Duration = null;
            }

            if ((Flags & 256) != 0)
            {
                Author = StringUtil.Deserialize(br);
            }
            else
            {
                Author = null;
            }

            if ((Flags & 512) != 0)
            {
                Document = (TLAbsDocument)ObjectUtils.DeserializeObject(br);
            }
            else
            {
                Document = null;
            }

            if ((Flags & 1024) != 0)
            {
                CachedPage = (TLPage)ObjectUtils.DeserializeObject(br);
            }
            else
            {
                CachedPage = null;
            }

            if ((Flags & 4096) != 0)
            {
                // manual edit: WebPageAttribute->TLWebPageAttributeTheme
                Attributes = (TLVector <TLWebPageAttributeTheme>)ObjectUtils.DeserializeVector <TLWebPageAttributeTheme> (br);
            }
            else
            {
                Attributes = null;
            }
        }
예제 #4
0
 public override void SerializeBody(BinaryWriter bw)
 {
     bw.Write(Constructor);
     bw.Write(Flags);
     bw.Write(Id);
     StringUtil.Serialize(Url, bw);
     StringUtil.Serialize(DisplayUrl, bw);
     bw.Write(Hash);
     if ((Flags & 1) != 0)
     {
         StringUtil.Serialize(Type, bw);
     }
     if ((Flags & 2) != 0)
     {
         StringUtil.Serialize(SiteName, bw);
     }
     if ((Flags & 4) != 0)
     {
         StringUtil.Serialize(Title, bw);
     }
     if ((Flags & 8) != 0)
     {
         StringUtil.Serialize(Description, bw);
     }
     if ((Flags & 16) != 0)
     {
         ObjectUtils.SerializeObject(Photo, bw);
     }
     if ((Flags & 32) != 0)
     {
         StringUtil.Serialize(EmbedUrl, bw);
     }
     if ((Flags & 32) != 0)
     {
         StringUtil.Serialize(EmbedType, bw);
     }
     if ((Flags & 64) != 0)
     {
         bw.Write(EmbedWidth.Value);
     }
     if ((Flags & 64) != 0)
     {
         bw.Write(EmbedHeight.Value);
     }
     if ((Flags & 128) != 0)
     {
         bw.Write(Duration.Value);
     }
     if ((Flags & 256) != 0)
     {
         StringUtil.Serialize(Author, bw);
     }
     if ((Flags & 512) != 0)
     {
         ObjectUtils.SerializeObject(Document, bw);
     }
     if ((Flags & 1024) != 0)
     {
         ObjectUtils.SerializeObject(CachedPage, bw);
     }
     if ((Flags & 4096) != 0)
     {
         ObjectUtils.SerializeObject(Attributes, bw);
     }
 }
예제 #5
0
 public override void SerializeBody(BinaryWriter bw)
 {
     bw.Write(Constructor);
     StringUtil.Serialize(Url, bw);
     ObjectUtils.SerializeObject(ChatInvite, bw);
 }
예제 #6
0
 public override void DeserializeBody(BinaryReader br)
 {
     Url        = StringUtil.Deserialize(br);
     ChatInvite = (TLAbsChatInvite)ObjectUtils.DeserializeObject(br);
 }