/* public QDChatDataTable Copy() * { * * } */ public void FillFromChatByPerson(QDChatList qdchat, QDChatPersons qdpersons) { if (this.Columns.Count < 1) { this.Init(); } this.Clear(); foreach (QDChatLine chatline in qdchat) { if (chatline.receiverid == qdpersons.Selected.id || chatline.senderid == qdpersons.Selected.id) { DataRow workRow = this.NewRow(); workRow["Date"] = chatline.timestamp.ToString(); workRow["Direction"] = ((chatline.chatdirection == 1) ? "OUT" : "IN"); workRow["Chat"] = chatline.chattext; this.Rows.Add(workRow); } } }
public int ReadFromChatList(QDChatList qdchatlist) { if (qdchatlist.Count > 0) { ResetCounter(); foreach (QDChatLine chatline in qdchatlist) { AddPersonToList(chatline.senderid, chatline, direction.sender); AddPersonToList(chatline.receiverid, chatline, direction.receiver); } List.Sort(new QDPersonsCountComparer()); List[0].isMe = true; Me = List[0]; if ((Selected.id == "") && (List.Count > 0)) { Selected = List[1]; } return(0); } else { return(-1); } }