Beispiel #1
0
        protected override void Execute()
        {
            IResource resFolder;

            if (!IsDataCorrect(out resFolder, _folder))
            {
                return;
            }

            IStatusWriter statusWriter = Core.UIManager.GetStatusWriter(this, StatusPane.Network);

            statusWriter.ShowStatus("Synchronizing folder " + _folder.Name + "...");

            OutlookSession.ProcessJobs();
            try
            {
                MailSync mailSync = new MailSync(false, _dateRestriction);
                mailSync.AddMailResources(Folder.GetMessageList(resFolder));
                mailSync.EnumerateMessageItems(_folder);
                mailSync.RemoveDeletedMailsFromIndex();
            }
            finally
            {
                statusWriter.ClearStatus();
            }
        }