Ejemplo n.º 1
0
            public bool FolderFetched(FolderDescriptor parent, FolderDescriptor folder, out FolderDescriptor folderTag)
            {
                folderTag = folder;
                IEFolder mapiFolder =
                    OutlookSession.OpenFolder(folder.FolderIDs.EntryId, folder.FolderIDs.StoreId);

                if (mapiFolder != null)
                {
                    using ( mapiFolder )
                    {
                        string name = mapiFolder.GetStringProp(MAPIConst.PR_DISPLAY_NAME);
                        Tracer._Trace(name);
                        string containerClass = mapiFolder.GetStringProp(MAPIConst.PR_CONTAINER_CLASS);
                        containerClass = containerClass;
                        EnumerateMailWithBody(mapiFolder);
                        for (int i = 0; i < 1; ++i)
                        {
                            EnumerateMail(mapiFolder);
                        }
                    }
                }
                if (parent == null)
                {
                    return(true);
                }
                return(true);
            }
Ejemplo n.º 2
0
        public FolderDescriptor(PairIDs IDs, IEFolder folder)
        {
            string name             = folder.GetStringProp(MAPIConst.PR_DISPLAY_NAME);
            string containerClass   = folder.GetStringProp(MAPIConst.PR_CONTAINER_CLASS);
            int    storeSupportMask = folder.GetLongProp(MAPIConst.PR_STORE_SUPPORT_MASK);
            int    contentCount     = folder.GetLongProp(MAPIConst.PR_CONTENT_COUNT);

            Init(IDs, name, containerClass, storeSupportMask, contentCount);
        }
Ejemplo n.º 3
0
 public override AbstractJob GetNextJob()
 {
     if (_folders != null)
     {
         IEFolder folder = null;
         while ((_index < _count) && folder == null)
         {
             folder = _folders.OpenFolder(_index++);
         }
         if (folder != null)
         {
             _tracer.Trace("folder = " + folder.GetStringProp(MAPIConst.PR_DISPLAY_NAME));
             OutlookSession.OutlookProcessor.QueueJob(new MailEnumeratorJob(folder));
             return(new FolderEnumeratorJob(folder));
         }
     }
     return(null);
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public void EnumerateMessageItems(FolderDescriptor folderDescriptor)
        {
            if (OutlookSession.WereProblemWithOpeningStorage(folderDescriptor.FolderIDs.StoreId) ||
                OutlookSession.WereProblemWithOpeningFolder(folderDescriptor.FolderIDs.EntryId))
            {
                return;
            }

            try
            {
                IEFolder mapiFolder =
                    OutlookSession.OpenFolder(folderDescriptor.FolderIDs.EntryId, folderDescriptor.FolderIDs.StoreId);
                if (mapiFolder == null)
                {
                    return;
                }
                using ( mapiFolder )
                {
                    string containerClass = mapiFolder.GetStringProp(MAPIConst.PR_CONTAINER_CLASS);
                    bool   taskFolder     = (FolderType.Task.Equals(containerClass));
                    if (taskFolder)
                    {
                        EnumerateTasks(folderDescriptor, mapiFolder);
                    }
                    else
                    {
                        EnumerateMail(folderDescriptor, mapiFolder);
                    }
                }
            }
            catch (COMException exception)
            {
                _tracer.TraceException(exception);
                if (exception.ErrorCode == MapiError.MAPI_E_NOT_ENOUGH_DISK)
                {
                    StandartJobs.MessageBox("Outlook reports that there is no enough disk space.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                OutlookSession.ProblemWithOpeningFolder(folderDescriptor.FolderIDs.EntryId);
                return;
            }
        }