Exemplo n.º 1
0
        public override WebMailMessageCollection LoadMessages(Folder fld)
        {
            WebMailMessageCollection returnColl = new WebMailMessageCollection();
            MailMessageCollection    messages;

            try
            {
                messages = _pop3Obj.DownloadEntireMessages();
            }
            catch (MailBeeException ex)
            {
                Log.WriteException(ex);
                throw new WebMailMailBeeException(ex);
            }
            if (messages != null)
            {
                foreach (MailMessage msg in messages)
                {
                    WebMailMessage webMsg = new WebMailMessage(_account);
                    webMsg.Init(msg, true, fld);
                    returnColl.Add(webMsg);
                }
            }
            return(returnColl);
        }
Exemplo n.º 2
0
        public override WebMailMessageCollection LoadMessages(object[] messageIndexSet, Folder fld)
        {
            WebMailMessageCollection msgsColl = new WebMailMessageCollection();

            foreach (string uid in messageIndexSet)
            {
                int index = _pop3Obj.GetMessageIndexFromUid(uid);
                if (index > 0)
                {
                    try
                    {
                        WebMailMessage webMsg = new WebMailMessage(_account);
                        webMsg.Init(_pop3Obj.DownloadEntireMessage(index), true, fld);
                        msgsColl.Add(webMsg);
                    }
                    catch (MailBeeException ex)
                    {
                        Log.WriteException(ex);
                        throw new WebMailMailBeeException(ex);
                    }
                }
                else
                {
                    continue;
                }
            }
            return(msgsColl);
        }
Exemplo n.º 3
0
        public override WebMailMessageCollection LoadMessageHeaders(object[] messageIndexSet, Folder fld)
        {
            WebMailMessageCollection msgsColl = new WebMailMessageCollection();

            foreach (object uid in messageIndexSet)
            {
                int index = _pop3Obj.GetMessageIndexFromUid(Convert.ToString(uid));
                if (index > 0)
                {
                    try
                    {
                        WebMailMessage webMsg = new WebMailMessage(_account);
                        webMsg.Init(_pop3Obj.DownloadMessageHeader(index), true, fld);
                        if (fld.SyncType == FolderSyncType.DirectMode)
                        {
                            webMsg.Seen = true;
                        }
                        msgsColl.Add(webMsg);
                    }
                    catch (MailBeeException ex)
                    {
                        Log.WriteException(ex);
                        throw new WebMailMailBeeException(ex);
                    }
                }
                else
                {
                    continue;
                }
            }
            return(msgsColl);
        }
 public WebMailMessageCollection(Account acct, MailMessageCollection messageCollection, bool isUidStr, Folder fld)
 {
     foreach (MailMessage msg in messageCollection)
     {
         WebMailMessage webMsg = new WebMailMessage(acct);
         webMsg.Init(msg, isUidStr, fld);
         Add(webMsg);
     }
 }
Exemplo n.º 5
0
        public override WebMailMessage LoadMessage(object index, Folder fld)
        {
            int indexOnServer = _pop3Obj.GetMessageIndexFromUid(index.ToString());

            try
            {
                if (indexOnServer > 0)
                {
                    WebMailMessage webMsg = new WebMailMessage(_account);
                    MailMessage    msg    = _pop3Obj.DownloadEntireMessage(indexOnServer);
                    webMsg.Init(msg, true, fld);
                    return(webMsg);
                }
                throw new WebMailMailBoxException((new WebmailResourceManagerCreator()).CreateResourceManager().GetString("PROC_MSG_HAS_DELETED"));
            }
            catch (MailBeeException ex)
            {
                Log.WriteException(ex);
                throw new WebMailMailBeeException(ex);
            }
        }