示例#1
0
        protected override void Execute()
        {
            if (OutlookSession.OutlookProcessor.ShuttingDown)
            {
                return;
            }

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

            statusWriter.ShowStatus("Performing background mail synchronization...");
            Tracer._Trace("MailSyncBackground is executed");
            foreach (IEMsgStore msgStore in OutlookSession.GetMsgStores())
            {
                if (OutlookSession.OutlookProcessor.ShuttingDown)
                {
                    break;
                }

                OutlookSession.ProcessJobs();

                if (msgStore == null)
                {
                    continue;
                }
                if (OutlookProcessor.IsIgnoredInfoStore(msgStore))
                {
                    continue;
                }

                string storeID = msgStore.GetBinProp(MAPIConst.PR_STORE_ENTRYID);
                string name    = msgStore.GetStringProp(MAPIConst.PR_DISPLAY_NAME);
                FolderDescriptorEnumerator.Do(msgStore, storeID, name, this);
            }
            statusWriter.ClearStatus();
            ProcessedFolders.DecRef();
        }