private static void InitPhoneNumber(DummyContactId contactId, DummyPhoneNumberId phoneNumberId, string firstName, string lastName, string phoneNumberValue, string phoneNumberValueStripped)
        {
            IPhoneNumber phoneNumber = new PhoneNumber(phoneNumberValue);
            Contact      contact     = new Contact((long)contactId, firstName, null, lastName, phoneNumber);

            InitPhoneNumberDual(phoneNumberId, phoneNumberValue, phoneNumberValueStripped);

            _DummyContacts[(int)phoneNumberId] = contact;
        }
        public static List <Contact> GetContacts(DummyContactId contactId)
        {
            List <Contact> matchingContacts = new List <Contact>();

            foreach (Contact c in _DummyContacts)
            {
                if (c.ContactId == (long)contactId)
                {
                    matchingContacts.Add(c);
                }
            }

            return(matchingContacts);
        }
        public static IConversation GetMergedConversation(DummyContactId contactId)
        {
            List <Contact> contacts = GetContacts(contactId);

            IEnumerable <TextMessage> messages = GetMessageSet(contactId);

            List <ChatRoomInformation> chatInfoItems = new List <ChatRoomInformation>();

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

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

            MergingConversationManager megingConversationManager = new MergingConversationManager(conversationManager, null);

            return(megingConversationManager.GetConversation(0));
        }
        public static List <TextMessage> GetMessageSet(DummyContactId contactId)
        {
            List <TextMessage> messages = new List <TextMessage>();

            IEnumerable <IContact> contacts = GetContacts(contactId);

            foreach (IContact contact in contacts)
            {
                foreach (PhoneNumber phoneNumber in contact.PhoneNumbers)
                {
                    string phoneNumberStripped = PhoneNumber.Strip(phoneNumber);
                    messages.AddRange(_DummyMessageSets[phoneNumberStripped]);
                }
            }

            return(messages);
        }
        private static void InitPhoneNumber(DummyContactId contactId, DummyPhoneNumberId phoneNumberId, string firstName, string lastName, string phoneNumberValue, string phoneNumberValueStripped)
        {
            IPhoneNumber phoneNumber = new PhoneNumber(phoneNumberValue);
            Contact contact = new Contact((long)contactId, firstName, null, lastName, phoneNumber);

            InitPhoneNumberDual(phoneNumberId, phoneNumberValue, phoneNumberValueStripped);

            _DummyContacts[(int)phoneNumberId] = contact;
        }
        public static List<TextMessage> GetMessageSet(DummyContactId contactId)
        {
            List<TextMessage> messages = new List<TextMessage>();

            IEnumerable<IContact> contacts = GetContacts(contactId);

            foreach (IContact contact in contacts)
            {
                foreach (PhoneNumber phoneNumber in contact.PhoneNumbers)
                {
                    string phoneNumberStripped = PhoneNumber.Strip(phoneNumber);
                    messages.AddRange(_DummyMessageSets[phoneNumberStripped]);
                }
            }

            return messages;
        }
        public static IConversation GetMergedConversation(DummyContactId contactId)
        {
            List<Contact> contacts = GetContacts(contactId);

            IEnumerable<TextMessage> messages = GetMessageSet(contactId);

            List<ChatRoomInformation> chatInfoItems = new List<ChatRoomInformation>();

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

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

            MergingConversationManager megingConversationManager = new MergingConversationManager(conversationManager, null);

            return megingConversationManager.GetConversation(0);
        }
        public static List<Contact> GetContacts(DummyContactId contactId)
        {
            List<Contact> matchingContacts = new List<Contact>();
            foreach (Contact c in _DummyContacts)
            {
                if (c.ContactId == (long)contactId)
                {
                    matchingContacts.Add(c);
                }
            }

            return matchingContacts;
        }
 private void VerifyMergedConversationDescription(DummyContactId contactId, string descriptionExpected)
 {
     IConversation conversation = DummyConversationDataGenerator.GetMergedConversation(contactId);
     VerifyConversationDescription(conversation, descriptionExpected);
 }
Exemplo n.º 10
0
 private ConversationManager CreateConversationManager(DummyContactId[] contactIds, DummyPhoneNumberId[] messageSetIds, ILoadingProgressCallback progressCallback)
 {
     DummyChatRoomId[] chatRoomIds = { };
     return CreateConversationManager(contactIds, messageSetIds, chatRoomIds, progressCallback);
 }
Exemplo n.º 11
0
        private ConversationManager CreateConversationManager(DummyContactId[] contactIds, DummyPhoneNumberId[] messageSetIds, DummyChatRoomId[] chatRoomIds, ILoadingProgressCallback progressCallback)
        {
            if (progressCallback != null)
            {
                int messageCount = DummyConversationDataGenerator.GetMessageCount(messageSetIds);
                int workEstimate = ConversationManager.GetWorkEstimate(contactIds.Length, messageCount, chatRoomIds.Length, 0);
                progressCallback.Begin(workEstimate);
            }

            ConversationManager conversationManager = DummyConversationDataGenerator.GetConversationManager(contactIds, messageSetIds, chatRoomIds, progressCallback);

            if (progressCallback != null)
            {
                progressCallback.End();
            }

            return conversationManager;
        }
        private void VerifyMergedConversationDescription(DummyContactId contactId, string descriptionExpected)
        {
            IConversation conversation = DummyConversationDataGenerator.GetMergedConversation(contactId);

            VerifyConversationDescription(conversation, descriptionExpected);
        }
        private void VerifyExportErrorString(DummyContactId contactId, Exception ex, string descriptionExpected)
        {
            IConversation conversation = DummyConversationDataGenerator.GetMergedConversation(contactId);

            VerifyExportErrorString(conversation, ex, descriptionExpected);
        }
 private void VerifyExportErrorString(DummyContactId contactId, Exception ex, string descriptionExpected)
 {
     IConversation conversation = DummyConversationDataGenerator.GetMergedConversation(contactId);
     VerifyExportErrorString(conversation, ex, descriptionExpected);
 }
        private MergingConversationManager CreateMergingConversationManager(DummyContactId[] contactIds, DummyPhoneNumberId[] messageSetIds, ILoadingProgressCallback progressCallback)
        {
            if (progressCallback != null)
            {
                int workEstimate = ConversationManager.GetWorkEstimate(contactIds.Length, messageSetIds.Length, 0, 0) +
                                   MergingConversationManager.GetWorkEstimateByContacts(contactIds.Length);
                progressCallback.Begin(workEstimate);
            }

            ConversationManager conversationManager = DummyConversationDataGenerator.GetConversationManager(contactIds, messageSetIds, progressCallback);

            if (progressCallback != null)
            {
                progressCallback.UpdateRemaining(MergingConversationManager.GetWorkEstimate(conversationManager.ConversationCount));
            }

            MergingConversationManager mergingConversationManager = new MergingConversationManager(conversationManager, progressCallback);

            if (progressCallback != null)
            {
                progressCallback.End();
            }

            return mergingConversationManager;
        }