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