Exemple #1
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;
 }
Exemple #2
0
 /// <summary>
 /// Constructor that hydrates this object from xml data transfer object
 /// </summary>
 public FacebookStreamPost(stream_post post)
 {
     this.ActionLinks              = new List <FacebookStreamActionLink>(from l in post.action_links.stream_action_link select new FacebookStreamActionLink(l));
     this.ActorId                  = post.actor_id;
     this.AppData                  = new FacebookStreamAppData(post.app_data);
     this.AppId                    = post.app_id.HasValue ? post.app_id.Value : 0;
     this.Attachment               = new FacebookStreamAttachment(post.attachment);
     this.Attribution              = post.attribution;
     this.Created                  = post.created_time;
     this.Likes                    = new FacebookStreamLikes(post.likes);
     this.Message                  = post.message;
     this.PostId                   = post.post_id;
     this.SourceId                 = post.source_id;
     this.TargetId                 = post.target_id.ToString();
     this.Type                     = post.type;
     this.Updated                  = post.updated_time;
     this.ViewerId                 = post.viewer_id;
     this.StreamComments           = new FacebookStreamComments();
     this.StreamComments.CanPost   = post.comments.can_post;
     this.StreamComments.CanRemove = post.comments.can_remove;
     this.StreamComments.Count     = post.comments.count;
     this.StreamComments.Comments  = new List <FacebookComment>(from c in post.comments.comment_list.comment select new FacebookComment(c));
 }