void CoreInfo_RefreshComment(CommentInfo comment) { lock (Comments) { var item = Comments.FirstOrDefault(cmme => cmme.CommentInfo.Id == comment.Id); var itemIdx = Comments.IndexOf(item); switch (comment.Status) { case PostStatusType.Removed: if (item != null) Comments.RemoveAt(itemIdx); break; case PostStatusType.First: case PostStatusType.Edited: var idx = 0; while (idx < Comments.Count && comment.PostDate > Comments[idx].CommentInfo.PostDate) idx++; if (item != null) { item.Refresh(comment); Comments.Move(itemIdx, idx); } else Comments.Insert(idx, new Comment(comment)); break; } } }
public PlusOneInfo(PlatformClient client, CommentInfo target) : base(client) { _lastUpdateMember = DateTime.MinValue; _targetId = "comment:" + target.Id; _activity = target.ParentActivity; }
public void Refresh(CommentInfo info) { CommentInfo = info; OnRefreshed(new EventArgs()); }
public Comment(CommentInfo info) { CommentInfo = info; }
public Comment(CommentInfo info) { Refresh(info); }