private commentdetail getdetail(int commentid) { try { commentdetail detail = new commentdetail(); comment 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) { comment 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); } }
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(); List <commentdetail> list = new List <commentdetail>(); GetParent(ref list, item.cid); list.Reverse(); foreach (var comment in list) { FloorsList.Add(comment); } } catch { } }