Пример #1
0
 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;
         }
     }
 }
Пример #2
0
 public void ResetCurrentConversation()
 {
     if (currentConversation != null)
     {
         currentConversation.bg.FillColor  = Color.FromArgb(16, 22, 37);
         currentConversation.bg.FillColor2 = Color.FromArgb(16, 22, 37);
         currentConversation = null;
     }
 }
Пример #3
0
 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();
 }
Пример #4
0
        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");
        }
Пример #5
0
 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);
 }