public bool FolderFetched(FolderDescriptor parent, FolderDescriptor folder, out FolderDescriptor folderTag) { folderTag = null; if (OutlookSession.OutlookProcessor.ShuttingDown) { return(false); } if (!Folder.IsIgnored(folder)) { ProcessedFolders.RegisterFolder(folder.FolderIDs.EntryId); RefreshFolderDescriptor.Do(JobPriority.BelowNormal, folder.FolderIDs, _dateRestrict); } return(true); }
private void RefreshFolder(PairIDs folderIDs, IResource folder) { Guard.NullArgument(folderIDs, "folderIDs"); Guard.NullArgument(folder, "folder"); FolderDescriptor descriptor = FolderDescriptor.Get(folderIDs); if (descriptor != null) { if (!ProcessedFolders.IsFolderProcessed(folder.GetStringProp(PROP.EntryID))) { RefreshFolderDescriptor.Do(JobPriority.Normal, descriptor, Settings.IndexStartDate); } } }
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(); }
public MailSyncBackground(DateTime dateRestrict) { ProcessedFolders.AddRef(); _dateRestrict = dateRestrict; }