示例#1
0
 /// <summary>
 /// Initializes a ActivityPost object
 /// </summary>
 /// <param name="post"></param>
 internal ActivityPost(FacebookStreamPost post)
 {
     CreatedTime       = post.CreatedTime;
     UpdatedTime       = post.UpdatedTime;
     Message           = post.Message;
     ActorUserId       = post.ActorId;
     TargetUserId      = !string.IsNullOrEmpty(post.TargetId) ? long.Parse(post.TargetId) : new Nullable <long>();
     CanLike           = post.Likes.CanLikes;
     HasLiked          = post.Likes.UserLikes;
     Likes             = new ActivityPostLikes(post.Likes);
     CanComment        = post.StreamComments != null ? post.StreamComments.CanPost : false;
     CanRemoveComments = post.StreamComments != null ? post.StreamComments.CanRemove : false;
     CommentCount      = post.StreamComments != null ? post.StreamComments.Count : 0;
     PostId            = post.PostId;
     Type        = post.Type;
     Attribution = post.Attribution;
     AppId       = post.AppId;
     Attachment  = new ActivityPostAttachment(post.Attachment);
     if (post.StreamComments != null)
     {
         _comments = new ActivityCommentCollection(post.StreamComments.Comments);
     }
     Likes.ProfileInfoChangeEvent += new EventHandler <EventArgs>(Likes_ProfileInfoChangeEvent);
     //FilterKey = post.FilterKey;
     //Permalink = post.Permalink;
 }
示例#2
0
        void OnGetFqlSteamQueryCompleted(stream_dataPosts posts, Object state, FacebookException e)
        {
            if (e != null || posts == null || posts.stream_post == null || posts.stream_post.Count == 0)
            {
                return;
            }

            var post = posts.stream_post[0];

            UpdatedTime = DateHelper.ConvertUnixTimeToDateTime(post.updated_time);
            HasLiked    = post.likes.user_likes;
            Likes       = new ActivityPostLikes(post.likes);

            this.NotifyPropertyChanged(PropertyChanged, o => o.UpdatedTime);
            this.NotifyPropertyChanged(PropertyChanged, o => o.HasLiked);
            this.NotifyPropertyChanged(PropertyChanged, o => o.Likes);
            this.NotifyPropertyChanged(PropertyChanged, o => o.LikedCount);
        }
示例#3
0
 /// <summary>
 /// Initializes a ActivityPost object
 /// </summary>
 /// <param name="post"></param>
 internal ActivityPost(stream_post post)
 {
     CreatedTime       = DateHelper.ConvertDoubleToDate(post.created_time); // TODO: Test conversion?
     UpdatedTime       = DateHelper.ConvertDoubleToDate(post.updated_time); // TODO: Test conversion?
     Message           = post.message;
     ActorUserId       = post.actor_id;
     TargetUserId      = post.target_id;
     CanLike           = post.likes.user_likes;
     HasLiked          = post.likes.user_likes;
     Likes             = new ActivityPostLikes(post.likes);
     CanComment        = post.comments.can_post;
     CanRemoveComments = post.comments.can_remove;
     CommentCount      = post.comments.count;
     PostId            = post.post_id;
     Type        = post.type;
     Attribution = post.attribution;
     AppId       = post.app_id;
     Attachment  = new ActivityPostAttachment(post.attachment);
     _comments   = new ActivityCommentCollection(post.comments.comment_list.comment);
     Likes.ProfileInfoChangeEvent += new EventHandler <EventArgs>(Likes_ProfileInfoChangeEvent);
     //FilterKey = post.filterkey;
     //Permalink = post.permalink;
 }