private commentdetail getdetail(int commentid)
 {
     try
     {
         var detail  = new commentdetail();
         var comment = result.commentContentArr[commentid];
         detail.cid       = comment.cid;;
         detail.content   = comment.content;
         detail.userName  = comment.userName;
         detail.userID    = comment.userID;
         detail.postDate  = comment.postDate;
         detail.userImg   = comment.userImg;
         detail.userClass = comment.userClass;
         detail.quoteId   = comment.quoteId;
         detail.count     = comment.count;
         detail.ups       = comment.ups;
         detail.downs     = comment.downs;
         if (comment.quoteId != 0)
         {
             var pcomment = result.commentContentArr[comment.quoteId];
             detail.pcid      = pcomment.cid;
             detail.pcontent  = pcomment.content;
             detail.puserName = pcomment.userName;
             detail.puserID   = pcomment.userID;
             detail.ppostDate = pcomment.postDate;
             detail.pquoteId  = pcomment.quoteId;
             detail.pcount    = pcomment.count;
         }
         return(detail);
     }
     catch { return(null); }
 }
Пример #2
0
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         ListBox listBox = sender as ListBox;
         if (listBox.SelectedIndex == -1)
         {
             return;
         }
         commentdetail item = listBox.SelectedItem as commentdetail;
         replayid   = item.cid;
         floor.Text = item.count + "";
     }
     catch (Exception) { }
 }
 private void SetFloorData(commentdetail item)
 {
     try
     {
         if (FloorsList.Count > 0)
         {
             floorbox.Reset(FloorsList[0]);
         }
         FloorsList.Clear();
         var list = new List <commentdetail>();
         GetParent(ref list, item.cid);
         list.Reverse();
         foreach (var comment in list)
         {
             FloorsList.Add(comment);
         }
     }
     catch { }
 }