Exemplo n.º 1
0
        public void ReloadConversationsAction()
        {
            currentUserId = yamsterCache.CurrentUserId;
            var privateGroup = yamsterCache.GetGroupById(YamsterGroup.ConversationsGroupId);

            conversationsByUserSet.Clear();

            foreach (var thread in privateGroup.Threads)
            {
                var participants = thread.ConversationParticipants;
                if (!chkShowMultiParticipant.Active)
                {
                    if (participants.Count > 2)
                    {
                        continue;
                    }
                }

                YamsterConversation conversation;
                if (!conversationsByUserSet.TryGetValue(participants, out conversation))
                {
                    conversation = new YamsterConversation(participants);
                    conversationsByUserSet.Add(conversation.UserSet, conversation);
                }

                conversation.AddThread(thread);
            }

            ctlGrid.ReplaceAllItems(
                conversationsByUserSet.Values.OrderByDescending(x => x.LastUpdate)
                );
        }
Exemplo n.º 2
0
 public bool Equals(YamsterConversation other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.UserSet.Equals(other.UserSet));
 }
Exemplo n.º 3
0
 void ctlGrid_FocusedItemChanged(object sender, EventArgs e)
 {
     if (ThreadViewer != null)
     {
         YamsterConversation conversation = ctlGrid.FocusedItem as YamsterConversation;
         if (conversation != null && conversation.Threads.Count > 0)
         {
             ThreadViewer.LoadMessageList(conversation.GetMessages());
         }
     }
 }