Пример #1
0
    public static StatusData ConvertFrom(StatusInfo statusInfo)
    {
        var data = new StatusData();
        data.CreatedAt = statusInfo.CreatedAt;
        data.ID = statusInfo.ID;
        data.Text = ProcessStatusText(statusInfo.Text);
        data.Source = statusInfo.Source;
        data.Favorited = statusInfo.Favorited;
        data.Truncated = statusInfo.Truncated;
        data.ReplyTo = statusInfo.ReplyTo;
        data.ReplyToUserId = statusInfo.ReplyToUserId;
        data.ReplyToUserScreenName = statusInfo.ReplyToUserScreenName;
        data.ThumbnailPic = statusInfo.ThumbnailPic;
        data.MiddlePic = statusInfo.MiddlePic;
        data.OriginalPic = statusInfo.OriginalPic;
        data.Mid = statusInfo.Mid;
        if (null != statusInfo.User)
            data.User = ConvertFrom(statusInfo.User);
        data.Geo = statusInfo.Geo;

        if (null != statusInfo.RetweetedStatus)
            data.RetweetedStatus = ConvertFrom(statusInfo.RetweetedStatus);

        return data;
    }
Пример #2
0
        private void AddStatusToView(StatusInfo status)
        {
            this.Dispatcher.Invoke(new Action<StatusInfo>(delegate(StatusInfo data)
            {
                viewModel.MyHomeStatuses.Insert(0, DataConverter.ConvertFrom(data));
                viewModel.MyStatuses.Insert(0, DataConverter.ConvertFrom(data));

            }), status);
        }
Пример #3
0
        public void RemoveStatusFromView(StatusInfo status)
        {
            this.syncContext.Send(new SendOrPostCallback(delegate(object state)
            {
                var found = this.MyStatuses.FirstOrDefault((d) => d.ID == status.ID);
                if (null != found)
                    this.MyStatuses.Remove(found);

                found = this.MyHomeStatuses.FirstOrDefault((d) => d.ID == status.ID);
                if (null != found)
                    this.MyHomeStatuses.Remove(found);

            }), null);
        }
Пример #4
0
        public void AddStatusToView(StatusInfo status)
        {
            this.syncContext.Send(new SendOrPostCallback(delegate(object state)
            {
                this.MyHomeStatuses.Insert(0, DataConverter.ConvertFrom(status));
                this.MyStatuses.Insert(0, DataConverter.ConvertFrom(status));

            }), null);
        }