Exemple #1
0
        public ContactDescriptor(IERowSet rowSet, int rowNum, string entryID, OutlookAddressBook addressBook)
        {
            _entryID       = entryID;
            _searchEntryID = _entryID;
            _addressBook   = addressBook;

            _emailAddresses = GetEmailAddresses( );
            if (_emailAddresses == null || _emailAddresses.Count == 0)
            {
                _contactNames.EmailAddress = rowSet.GetStringProp(2, rowNum);  //row.FindStringProp( MAPIConst.PR_EMAIL_ADDRESS );
            }
            else
            {
                _contactNames.EmailAddress = _emailAddresses[0] as string;
            }

            string fullName = rowSet.GetStringProp(1, rowNum);  //row.FindStringProp( MAPIConst.PR_DISPLAY_NAME );

            if (fullName != null)
            {
                fullName = fullName.Trim();
            }
            _contactNames.FullName = fullName;
            //_phones = contactProperties.GetPhones();
            //_birthday = contactProperties.BirthDay;
        }
Exemple #2
0
        private string ProcessRow(IERowSet row, FolderDescriptor folder,
                                  IEFolder mapiFolder, ref int indexed)
        {
            string entryID = row.GetBinProp(1);

            if (entryID == null)
            {
                entryID = row.GetBinProp(0);
            }
            string messageClass = row.GetStringProp(3);

            if (messageClass == null)
            {
                messageClass = string.Empty;
            }

            IResource email =
                Core.ResourceStore.FindUniqueResource(STR.Email, PROP.EntryID, entryID);

            if (email != null)
            {
                _mailsInOldIndex.TestID(email.Id);
                UpdateMail(row, email, messageClass, entryID, folder, mapiFolder);
                indexed++;
            }
            else
            {
                AddMail(messageClass, entryID, folder, mapiFolder, row.GetStringProp(7));
                indexed++;
            }
            OutlookSession.ProcessJobs();
            return(entryID);
        }
Exemple #3
0
            private void ProcessRow(IERowSet row, IEFolder mapiFolder)
            {
                mapiFolder = mapiFolder;
                string entryID = row.GetBinProp(1);

                if (entryID == null)
                {
                    entryID = row.GetBinProp(0);
                }
                string messageClass = row.GetStringProp(3);

                messageClass = messageClass;
            }
Exemple #4
0
        private static void ProcessRow(ArrayList ownerEmails, ArrayList ownerNames, IETable table)
        {
            IERowSet row = table.GetNextRow();

            if (row == null)
            {
                return;
            }
            using ( row )
            {
                string senderEmail = row.GetStringProp(0);
                string senderName  = row.GetStringProp(1);
                if (senderEmail != null && senderEmail.Length > 0 && ownerEmails.IndexOf(senderEmail) == -1)
                {
                    ownerEmails.Add(senderEmail);
                }
                if (senderName != null && senderName.Length > 0 && ownerNames.IndexOf(senderName) == -1)
                {
                    ownerNames.Add(senderName);
                }
            }
        }
Exemple #5
0
        private void UpdateMail(IERowSet row, IResource email, string messageClass, string entryId,
                                FolderDescriptor folder, IEFolder mapiFolder)
        {
            Guard.NullArgument(messageClass, "messageClass");

            bool checkForDateTimeNeeded = false;
            bool bWereChanges           = false;
            bool interpretAsMail        = MessageType.InterpretAsMail(messageClass);

            if (interpretAsMail)
            {
                bWereChanges = WereChanges(row, email, out checkForDateTimeNeeded);
            }

            if (bWereChanges)
            {
                IEMessage message = OutlookSession.OpenMessage(folder.FolderIDs.EntryId, mapiFolder, entryId);
                if (message == null)
                {
                    return;
                }

                using ( message )
                {
                    if (checkForDateTimeNeeded)
                    {
                        DateTime lastModifiedDate = message.GetDateTimeProp(MAPIConst.PR_LAST_MODIFICATION_TIME);
                        lastModifiedDate = lastModifiedDate.ToUniversalTime();
                        if (lastModifiedDate.Equals(email.GetProp(PROP.LastModifiedTime)))
                        {
                            bWereChanges = false;
                        }
                    }
                    if (bWereChanges)
                    {
                        Core.ResourceAP.QueueJob(new MailDescriptor(folder, entryId, message, MailDescriptor.UpdateState, row.GetStringProp(7)));
                    }
                    else
                    {
                        Core.ResourceAP.QueueJob(new SyncOnlyMailDescriptor(folder, entryId, message));
                    }
                }
            }
            else
            {
                MailSyncToFolder.LinkOrDelete(folder, email);
            }
        }