public override AbstractJob GetNextJob() { IEMsgStore msgStore = null; while ((_index < _msgStores.Count) && msgStore == null) { msgStore = _msgStores.GetMsgStore(_index++); } if (msgStore == null) { return(null); } return(new FolderEnumeratorJob(msgStore.GetRootFolder())); }
public static bool IsStorageSupported(IEMsgStore msgStore) { if (Settings.SupportIMAP) { return(true); } IEFolder root = msgStore.GetRootFolder(); if (root == null) { return(true); } using ( root ) { IEFolders folders = OutlookSession.GetFolders(root); if (folders == null) { return(true); } using ( folders ) { int count = folders.GetCount(); for (int i = 0; i < count; ++i) { IEFolder folder = OpenFolder(folders, i); if (folder == null) { continue; } using ( folder ) { string containerClass = folder.GetStringProp(MAPIConst.PR_CONTAINER_CLASS); if (FolderType.IMAP == containerClass) { return(false); } } } } } return(true); }
public void Enumerate() { IEFolder folder = _msgStore.GetRootFolder(); if (folder != null) { using ( folder ) { FolderDescriptor tag = null; FolderDescriptor folderDescriptor = FolderDescriptor.Get(_storeID, folder); folderDescriptor.Name = _storeName; bool continueEnumerate = _enumListener.FolderFetched(null, folderDescriptor, out tag); if (continueEnumerate) { OutlookSession.ProcessJobs(); EnumerateInternal(folder, tag); } } } }
public MAPIInfoStoreDescriptor(IEMsgStore msgStore) { _name = msgStore.GetStringProp(MAPIConst.PR_DISPLAY_NAME); _entryId = msgStore.GetBinProp(MAPIConst.PR_ENTRYID); _deletedItemsId = msgStore.GetBinProp(MAPIConst.PR_IPM_WASTEBASKET_ENTRYID); MAPIIDs mapiIds = msgStore.GetInboxIDs(); if (mapiIds != null) { AddDefaultFolderEntryID(mapiIds.EntryID); } AddDefaultFolderEntryID(_deletedItemsId); AddDefaultFolderEntryID(msgStore.GetBinProp(MAPIConst.PR_IPM_SENTMAIL_ENTRYID)); AddDefaultFolderEntryID(msgStore.GetBinProp(MAPIConst.PR_IPM_OUTBOX_ENTRYID)); IEFolder rootFolder = msgStore.GetRootFolder(); if (rootFolder != null) { using ( rootFolder ) { string parentEntryId = rootFolder.GetBinProp(MAPIConst.PR_PARENT_ENTRYID); if (parentEntryId != null) { IEFolder parentFolder = msgStore.OpenFolder(parentEntryId); if (parentFolder != null) { using ( parentFolder ) { AddDefaultFolderEntryID(parentFolder.GetBinProp(MAPIConst.PR_IPM_APPOINTMENT_ENTRYID)); AddDefaultFolderEntryID(parentFolder.GetBinProp(MAPIConst.PR_IPM_CONTACT_ENTRYID)); AddDefaultFolderEntryID(parentFolder.GetBinProp(MAPIConst.PR_IPM_DRAFTS_ENTRYID)); AddDefaultFolderEntryID(parentFolder.GetBinProp(MAPIConst.PR_IPM_JOURNAL_ENTRYID)); AddDefaultFolderEntryID(parentFolder.GetBinProp(MAPIConst.PR_IPM_NOTE_ENTRYID)); AddDefaultFolderEntryID(parentFolder.GetBinProp(MAPIConst.PR_IPM_TASK_ENTRYID)); ArrayList additionalRenEntryIDs = parentFolder.GetBinArray(MAPIConst.PR_ADDITIONAL_REN_ENTRYIDS); if (additionalRenEntryIDs != null && additionalRenEntryIDs.Count > 4) { _junkEmailId = additionalRenEntryIDs[4] as string; } if (additionalRenEntryIDs != null) { foreach (string id in additionalRenEntryIDs) { AddDefaultFolderEntryID(id); } } } } } } } _supportMask = msgStore.GetLongProp(MAPIConst.PR_STORE_SUPPORT_MASK); _resource = Core.ResourceStore.FindUniqueResource(STR.MAPIInfoStore, PROP.EntryID, _entryId); _storeTypeChecked = _resource == null?false:_resource.HasProp(PROP.StoreTypeChecked); if (_resource == null || !_storeTypeChecked) { try { _supported = OutlookSession.IsStorageSupported(msgStore); _storeTypeChecked = true; } catch (COMException exception) { Tracer._TraceException(exception); } } else { _supported = _resource.HasProp(PROP.StoreSupported); } }