public static IConversation GetChatConversation(DummyChatRoomId chatRoomId)
        {
            List <IContact>            contacts      = new List <IContact>();
            List <TextMessage>         messages      = DummyConversationDataGenerator.GetMessageSet(chatRoomId);
            List <ChatRoomInformation> chatInfoItems = new List <ChatRoomInformation>();
            ChatRoomInformation        chatRoomInfo  = GetChatRoomInfo(chatRoomId);

            chatInfoItems.Add(chatRoomInfo);
            List <MessageAttachment> attachments = new List <MessageAttachment>();

            foreach (string phoneNumberValue in chatRoomInfo.Participants)
            {
                IContact associatedContact = GetContactByPhoneNumber(phoneNumberValue);
                if (associatedContact != null)
                {
                    contacts.Add(associatedContact);
                }
            }

            ConversationManager conversationManager = new ConversationManager(contacts, messages, chatInfoItems, attachments, null);

            foreach (IConversation conversation in conversationManager)
            {
                if (conversation.MessageCount > 0)
                {
                    return(conversation);
                }
            }

            throw new ArgumentException("Shouldn't reach here!");
        }
        public static IConversation GetSingleConversation(DummyPhoneNumberId messageSetId)
        {
            Contact        contact  = GetAssociatedContact(messageSetId);
            List <Contact> contacts = new List <Contact>(1);

            if (contact != null)
            {
                contacts.Add(contact);
            }
            List <TextMessage>         messages      = DummyConversationDataGenerator.GetMessageSet(messageSetId);
            List <ChatRoomInformation> chatInfoItems = new List <ChatRoomInformation>();
            List <MessageAttachment>   attachments   = new List <MessageAttachment>();

            ConversationManager conversationManager = new ConversationManager(contacts, messages, chatInfoItems, attachments, null);

            return(conversationManager.GetConversation(0));
        }
        public static ConversationManager GetConversationManager(IEnumerable <DummyContactId> dummyContactIds,
                                                                 IEnumerable <DummyPhoneNumberId> messageSetIds,
                                                                 IEnumerable <DummyChatRoomId> chatRoomIds,
                                                                 ILoadingProgressCallback progressCallback)
        {
            List <Contact> contacts = DummyConversationDataGenerator.GetContacts(dummyContactIds);

            List <TextMessage> messages = DummyConversationDataGenerator.GetMessages(messageSetIds);

            messages.AddRange(DummyConversationDataGenerator.GetMessages(chatRoomIds));

            List <ChatRoomInformation> chatInfoItems = DummyConversationDataGenerator.GetChatRoomInfoItems(chatRoomIds);

            List <MessageAttachment> attachments = new List <MessageAttachment>();

            return(new ConversationManager(contacts, messages, chatInfoItems, attachments, progressCallback));
        }