Ejemplo n.º 1
0
 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;
         }
     }
 }
Ejemplo n.º 2
0
 public PlusOneInfo(PlatformClient client, CommentInfo target)
     : base(client)
 {
     _lastUpdateMember = DateTime.MinValue;
     _targetId = "comment:" + target.Id;
     _activity = target.ParentActivity;
 }        
Ejemplo n.º 3
0
 public void Refresh(CommentInfo info)
 {
     CommentInfo = info;
     OnRefreshed(new EventArgs());
 }
Ejemplo n.º 4
0
 public Comment(CommentInfo info)
 {
     CommentInfo = info;
 }
Ejemplo n.º 5
0
 public Comment(CommentInfo info)
 {
     Refresh(info);
 }