Provides data for IMAP events.
Example #1
0
        /// <summary>
        /// Raises event 'RenameMailbox'.
        /// </summary>
        /// <param name="session">Reference to IMAP session.</param>
        /// <param name="mailbox">Mailbox which to rename.</param>
        /// <param name="newMailboxName">New mailbox name.</param>
        /// <returns></returns>
        internal string OnRenameMailbox(IMAP_Session session, string mailbox, string newMailboxName)
        {
            if (this.RenameFolder != null)
            {
                Mailbox_EventArgs eArgs = new Mailbox_EventArgs(mailbox, newMailboxName);
                this.RenameFolder(session, eArgs);

                return(eArgs.ErrorText);
            }

            return(null);
        }
Example #2
0
        /// <summary>
        /// Raises event 'DeleteMailbox'.
        /// </summary>
        /// <param name="session">Reference to IMAP session.</param>
        /// <param name="mailbox">Mailbox which to delete.</param>
        /// <returns></returns>
        internal string OnDeleteMailbox(IMAP_Session session, string mailbox)
        {
            if (this.DeleteFolder != null)
            {
                Mailbox_EventArgs eArgs = new Mailbox_EventArgs(mailbox);
                this.DeleteFolder(session, eArgs);

                return(eArgs.ErrorText);
            }

            return(null);
        }
        private void IMAP_Server_UnSubscribeFolder(object sender, Mailbox_EventArgs e)
        {
            IMAP_Session ses = (IMAP_Session)sender;

            m_pAPI.UnSubscribeFolder(ses.UserName,e.Folder);
        }
        private void IMAP_Server_RenameFolder(object sender, Mailbox_EventArgs e)
        {
            try
            {
                IMAP_Session ses = (IMAP_Session)sender;

                m_pAPI.RenameFolder(ses.UserName,e.Folder,e.NewFolder);
            }
            catch(Exception x){
                e.ErrorText = x.Message;
            }
        }