Exemplo n.º 1
0
        public override void Update(TLPhotoBase photo)
        {
            var p = photo as TLPhoto;

            if (p != null)
            {
                base.Update(p);

                AccessHash = p.AccessHash;
                UserId     = p.UserId;
                Date       = p.Date;
                Caption    = p.Caption;
                Geo        = p.Geo;

                if (AccessHash.Value != p.AccessHash.Value)
                {
                    Sizes = p.Sizes;
                }
                else
                {
                    for (var i = 0; i < Sizes.Count; i++)
                    {
                        Sizes[i].Update(p.Sizes[i]);
                    }
                }
            }
        }
        public override TLObject FromStream(Stream input)
        {
            PrevPhoto = GetObject <TLPhotoBase>(input);
            NewPhoto  = GetObject <TLPhotoBase>(input);

            return(this);
        }
Exemplo n.º 3
0
        public override TLObject FromBytes(byte[] bytes, ref int position)
        {
            bytes.ThrowExceptionIfIncorrect(ref position, Signature);

            Photo = GetObject <TLPhotoBase>(bytes, ref position);

            return(this);
        }
Exemplo n.º 4
0
        public override TLObject FromStream(Stream input)
        {
            Id          = GetObject <TLString>(input);
            Type        = GetObject <TLString>(input);
            Photo       = GetObject <TLPhotoBase>(input);
            SendMessage = GetObject <TLBotInlineMessageBase>(input);

            return(this);
        }
Exemplo n.º 5
0
        public override void Update(TLPhotoBase photo)
        {
            var mediaPhoto = photo as TLMediaPhotoBase;

            if (mediaPhoto != null)
            {
                Id = mediaPhoto.Id;
            }
        }
Exemplo n.º 6
0
        public override TLObject FromStream(Stream input)
        {
            Photo = GetObject <TLPhotoBase>(input);

            var isoFileName = GetObject <TLString>(input);

            IsoFileName = isoFileName.ToString();

            return(this);
        }
Exemplo n.º 7
0
        public override TLObject FromBytes(byte[] bytes, ref int position)
        {
            bytes.ThrowExceptionIfIncorrect(ref position, Signature);

            Id          = GetObject <TLString>(bytes, ref position);
            Type        = GetObject <TLString>(bytes, ref position);
            Photo       = GetObject <TLPhotoBase>(bytes, ref position);
            SendMessage = GetObject <TLBotInlineMessageBase>(bytes, ref position);

            return(this);
        }
Exemplo n.º 8
0
        public override TLObject FromStream(Stream input)
        {
            Id             = GetObject <TLInt>(input);
            _title         = GetObject <TLString>(input);
            _photo         = GetObject <TLPhotoBase>(input);
            ParticipantIds = GetObject <TLVector <TLInt> >(input);

            Participants   = GetObject <TLObject>(input) as TLChatParticipantsBase;
            NotifySettings = GetObject <TLObject>(input) as TLPeerNotifySettingsBase;

            return(this);
        }
Exemplo n.º 9
0
        public override TLObject FromBytes(byte[] bytes, ref int position)
        {
            bytes.ThrowExceptionIfIncorrect(ref position, Signature);

            Id                = GetObject <TLInt>(bytes, ref position);
            _title            = GetObject <TLString>(bytes, ref position);
            _photo            = GetObject <TLPhotoBase>(bytes, ref position);
            ParticipantsCount = GetObject <TLInt>(bytes, ref position);
            Date              = GetObject <TLInt>(bytes, ref position);
            Left              = GetObject <TLBool>(bytes, ref position);
            Version           = GetObject <TLInt>(bytes, ref position);

            return(this);
        }
Exemplo n.º 10
0
        public override TLObject FromStream(Stream input)
        {
            Id                = GetObject <TLInt>(input);
            _title            = GetObject <TLString>(input);
            _photo            = GetObject <TLPhotoBase>(input);
            ParticipantsCount = GetObject <TLInt>(input);
            Date              = GetObject <TLInt>(input);
            Left              = GetObject <TLBool>(input);
            Version           = GetObject <TLInt>(input);

            Participants   = GetObject <TLObject>(input) as TLChatParticipantsBase;
            NotifySettings = GetObject <TLObject>(input) as TLPeerNotifySettingsBase;

            return(this);
        }
Exemplo n.º 11
0
        public override void Update(TLChatBase chat)
        {
            base.Update(chat);
            var c = chat as TLBroadcastChat;

            if (c != null)
            {
                _title = c.Title;
                if (Photo.GetType() != c.Photo.GetType())
                {
                    _photo = c.Photo;
                }
                else
                {
                    Photo.Update(c.Photo);
                }
                ParticipantIds = c.ParticipantIds;
            }
        }
Exemplo n.º 12
0
        public override void Update(TLChatBase chat)
        {
            base.Update(chat);
            var c = chat as TLChat;

            if (c != null)
            {
                _title = c.Title;
                if (Photo.GetType() != c.Photo.GetType())
                {
                    _photo = c.Photo;    // при удалении фото чата не обновляется UI при _photo = c.Photo
                }
                else
                {
                    Photo.Update(c.Photo);
                }
                ParticipantsCount = c.ParticipantsCount;
                Date    = c.Date;
                Left    = c.Left;
                Version = c.Version;
            }
        }
Exemplo n.º 13
0
        public override void Update(TLPhotoBase photo)
        {
            var photoCommon = photo as TLPhotoCommon;

            if (photoCommon != null)
            {
                if (PhotoSmall != null)
                {
                    PhotoSmall.Update(photoCommon.PhotoSmall);
                }
                else
                {
                    PhotoSmall = photoCommon.PhotoSmall;
                }
                if (PhotoBig != null)
                {
                    PhotoBig.Update(photoCommon.PhotoBig);
                }
                else
                {
                    PhotoBig = photoCommon.PhotoBig;
                }
            }
        }
Exemplo n.º 14
0
 public abstract void Update(TLPhotoBase photo);
Exemplo n.º 15
0
 public override void Update(TLPhotoBase photo)
 {
 }