public void SelectConversation(ReferenceData.Entity.Conversation cv) { foreach (var cvst in ConversationList) { if (cvst.Cvst.Equals(cv)) { if (!cvst.Equals(this.currentConversation)) { if (this.currentConversation == null) { this.currentConversation = cvst; } else { this.currentConversation.bg.FillColor = Color.FromArgb(16, 22, 37); this.currentConversation.bg.FillColor2 = Color.FromArgb(16, 22, 37); this.currentConversation = cvst; } this.currentConversation.bg.FillColor = Color.FromArgb(250, 48, 90); this.currentConversation.bg.FillColor2 = Color.FromArgb(128, 36, 206); } break; } } }
public void ResetCurrentConversation() { if (currentConversation != null) { currentConversation.bg.FillColor = Color.FromArgb(16, 22, 37); currentConversation.bg.FillColor2 = Color.FromArgb(16, 22, 37); currentConversation = null; } }
public void AddConversationList(List <ReferenceData.Entity.Conversation> list) { foreach (var c in list) { Components.Conversation cvst = new Components.Conversation(c, User); cvst.ConversationClick(new OpenConversationHandler(this, cvst).Handle); ConversationList.Add(cvst); } DisplayConversations(); }
public void InitLatestMessage(Components.Conversation cvst, ReferenceData.Entity.Message message) { if (message.messageType.Equals("FILE")) { string[] arr = message.content.Split('_'); string fex = arr[arr.Length - 1]; if (fex.Equals(".jpg") || fex.Equals(".png") || fex.Equals(".jpeg") || fex.Equals(".gif")) { cvst.lbLatestMessage.Text = (message.senderId != cvst.Acc.id ? message.lastName : "Bạn") + " đã gửi một ảnh."; } else { cvst.lbLatestMessage.Text = (message.senderId != cvst.Acc.id ? message.lastName : "Bạn") + " đã gửi một file."; } } else { cvst.lbLatestMessage.Text = (message.senderId != cvst.Acc.id ? message.lastName : "Bạn") + ": " + message.content; } DateTime time = (DateTime)message.createdAt; cvst.lbDate.Text = time.ToString("HH:mm dd/MM/yyyy"); }
public void InsertConversationList(ReferenceData.Entity.Conversation cv) { Components.Conversation cvst = new Components.Conversation(cv, User); cvst.ConversationClick(new OpenConversationHandler(this, cvst).Handle); ConversationList.Add(cvst); }