Example #1
0
        private bool IsClearNeededImpl(IResource contact)
        {
            IEFolder folder = GetContactFolder(contact, false);

            if (folder == null)
            {
                return(false);
            }

            bool       newCreated;
            IEMAPIProp message = OpenMessage(folder, contact, false, false, false, out newCreated);

            if (message == null)
            {
                return(true);
            }
            using ( message )
            {
                string           folderID         = message.GetBinProp(MAPIConst.PR_PARENT_ENTRYID);
                FolderDescriptor folderDescriptor = FolderDescriptor.Get(folderID, message.GetBinProp(MAPIConst.PR_STORE_ENTRYID));
                if (folderDescriptor == null || folderDescriptor.ContainerClass != FolderType.Contact)
                {
                    return(true);
                }
                return(false);
            }
        }
Example #2
0
        protected override void Execute()
        {
            IEMAPIProp message = OpenMessage(_contact, false, true, true);

            if (message == null)
            {
                if (_newCreated)
                {
                    _tracer.Trace("Cannot Export NEW contact for resource id = " + _contact.Id);
                }
                _tracer.Trace("Cannot Export contact for resource id = " + _contact.Id);
                return;
            }
            using ( message )
            {
                ExportCategories.ProcessCategories(message, _contact);
                OutlookSession.SaveChanges(_newCreated, "Export contact for resource id = " + _contact.Id, message, message.GetBinProp(MAPIConst.PR_ENTRYID));
            }
        }
Example #3
0
        protected override void Execute()
        {
            if (Settings.TraceContactChanges)
            {
                Trace("Try to export contact");
                _resTracer.Trace(_contact);
            }
            IEMAPIProp message = OpenMessage(_contact, _createNew, true, true);

            if (message == null)
            {
                if (_newCreated)
                {
                    _tracer.Trace("Cannot Export NEW contact for resource id = " + _contact.Id);
                }
                _tracer.Trace("Cannot Export contact for resource id = " + _contact.Id);
                return;
            }
            using ( message )
            {
                IContact contactBO = Core.ContactManager.GetContact(_contact);
                ExportProperties(message, contactBO);
                ExportPhones(contactBO, message);
                SetEmailAddress(message);
                if (Settings.SyncContactCategory)
                {
                    SetCategories(message);
                }
                _lastContact = _contact;
                OutlookSession.SaveChanges(_newCreated, "Export contact for resource id = " + _contact.Id, message, message.GetBinProp(MAPIConst.PR_ENTRYID));
            }
        }