Exemplo n.º 1
0
        public DirectMessageItem(DirectMessage target, bool sentByMe)
        {
            this.Dm = target;
            if (sentByMe)
            {
                this.UserData = target.Recipient;
            }
            else
            {
                this.UserData = target.Sender;
            }
            this.ScreenName   = this.UserData.ScreenName;
            this.Name         = this.UserData.Name;
            this.IconUrl      = this.UserData.ProfileImageUrl;
            this.IsLockedUser = this.UserData.IsProtected;
            this.Time         = target.CreatedAt.LocalDateTime;
            this.Text         = WebUtility.HtmlDecode(target.Text);

            if (target.Entities.Media != null)
            {
                foreach (MediaEntity me in target.Entities.Media)
                {
                    ContentsItem ci = new ContentsItem(me.MediaUrl);
                    this.contentsItemList.Add(ci);
                }
            }
        }
Exemplo n.º 2
0
        public TimeLineItem(Status status, string myScreenName)
        {
            this.myScreenName = myScreenName;
            this.IsRetweeted  = status.RetweetedStatus != null;
            if (this.IsRetweeted)
            {
                this.RtScreenName = status.User.ScreenName;
                this.RtName       = status.User.Name;
                this.RtIconUrl    = status.User.ProfileImageUrl;
                status            = status.RetweetedStatus;
            }
            User user = status.User;

            this.ScreenName   = user.ScreenName;
            this.Name         = user.Name;
            this.IconUrl      = user.ProfileImageUrl;
            this.IsLockedUser = user.IsProtected;
            this.Time         = status.CreatedAt.LocalDateTime;
            setVia(status.Source);
            this.Text  = WebUtility.HtmlDecode(status.Text);
            this.IsFav = status.IsFavorited == true;

            if (status.ExtendedEntities != null)
            {
                foreach (MediaEntity me in status.ExtendedEntities.Media)
                {
                    ContentsItem ci = new ContentsItem(me.MediaUrl);
                    this.contentsItemList.Add(ci);
                }
            }

            if (status.InReplyToStatusId != null)
            {
                this.HasTalk = true;
            }

            this.Tweet = status;
        }