コード例 #1
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            // Example:    S: * LSUB (\Noselect) "/" ~/Mail/foo

            StringBuilder retVal = new StringBuilder();

            retVal.Append("* LSUB (");
            if (m_pFolderAttributes != null)
            {
                for (int i = 0; i < m_pFolderAttributes.Length; i++)
                {
                    if (i > 0)
                    {
                        retVal.Append(" ");
                    }
                    retVal.Append(m_pFolderAttributes[i]);
                }
            }
            retVal.Append(") ");
            retVal.Append("\"" + m_Delimiter + "\" ");
            retVal.Append(IMAP_Utils.EncodeMailbox(m_FolderName, encoding));
            retVal.Append("\r\n");

            return(retVal.ToString());
        }
コード例 #2
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            // Example:    S: * STATUS blurdybloop (MESSAGES 231 UIDNEXT 44292)

            StringBuilder retVal = new StringBuilder();

            retVal.Append("* STATUS");
            retVal.Append(" " + IMAP_Utils.EncodeMailbox(m_FolderName, encoding));
            retVal.Append(" (");
            bool firstItem = true;

            if (m_MessageCount >= 0)
            {
                retVal.Append("MESSAGES " + m_MessageCount);
                firstItem = false;
            }
            if (m_RecentCount >= 0)
            {
                if (!firstItem)
                {
                    retVal.Append(' ');
                }
                retVal.Append("RECENT " + m_RecentCount);
                firstItem = false;
            }
            if (m_UidNext >= 0)
            {
                if (!firstItem)
                {
                    retVal.Append(' ');
                }
                retVal.Append("UIDNEXT " + m_UidNext);
                firstItem = false;
            }
            if (m_FolderUid >= 0)
            {
                if (!firstItem)
                {
                    retVal.Append(' ');
                }
                retVal.Append("UIDVALIDITY " + m_FolderUid);
                firstItem = false;
            }
            if (m_UnseenCount >= 0)
            {
                if (!firstItem)
                {
                    retVal.Append(' ');
                }
                retVal.Append("UNSEEN " + m_UnseenCount);
                firstItem = false;
            }
            retVal.Append(")\r\n");

            return(retVal.ToString());
        }
コード例 #3
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            // Example:    S: * LISTRIGHTS ~/Mail/saved smith la r swicdkxte

            StringBuilder retVal = new StringBuilder();

            retVal.Append("* LISTRIGHTS " + IMAP_Utils.EncodeMailbox(m_FolderName, encoding) + " \"" + m_RequiredRights + "\" " + m_OptionalRights + "\r\n");

            return(retVal.ToString());
        }
コード例 #4
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            // Example:    S: * MYRIGHTS INBOX rwiptsldaex

            StringBuilder retVal = new StringBuilder();

            retVal.Append("* MYRIGHTS " + IMAP_Utils.EncodeMailbox(m_FolderName, encoding) + " \"" + m_pRights + "\"\r\n");

            return(retVal.ToString());
        }
コード例 #5
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            // Example:    S: * QUOTAROOT INBOX ""

            StringBuilder retVal = new StringBuilder();
            retVal.Append("* QUOTAROOT " + IMAP_Utils.EncodeMailbox(m_FolderName,encoding));
            foreach(string root in m_QuotaRoots){
                retVal.Append(" \"" + root + "\"");
            }
            retVal.Append("\r\n");

            return retVal.ToString();
        }
コード例 #6
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            // Example:    S: * ACL INBOX Fred rwipslda test rwipslda

            StringBuilder retVal = new StringBuilder();

            retVal.Append("* ACL ");
            retVal.Append(IMAP_Utils.EncodeMailbox(m_FolderName, encoding));
            foreach (IMAP_Acl_Entry e in m_pEntries)
            {
                retVal.Append(" \"" + e.Identifier + "\" \"" + e.Rights + "\"");
            }
            retVal.Append("\r\n");

            return(retVal.ToString());
        }
コード例 #7
0
        /// <summary>
        /// Returns this as string.
        /// </summary>
        /// <param name="encoding">Specifies how mailbox name is encoded.</param>
        /// <returns>Returns this as string.</returns>
        public override string ToString(IMAP_Mailbox_Encoding encoding)
        {
            /*
             *  Example:  S: * LIST (\Noselect) "/" ~/Mail/foo
             *
             *            C: A101 LIST "" ""
             *            S: * LIST (\Noselect) "/" ""
             *            S: A101 OK LIST Completed
             */

            // Hierarchy delimiter request.
            if (string.IsNullOrEmpty(m_FolderName))
            {
                return("* LIST (\\Noselect) \"/\" \"\"\r\n");
            }
            else
            {
                StringBuilder retVal = new StringBuilder();
                retVal.Append("* LIST (");
                if (m_pFolderAttributes != null)
                {
                    for (int i = 0; i < m_pFolderAttributes.Length; i++)
                    {
                        if (i > 0)
                        {
                            retVal.Append(" ");
                        }
                        retVal.Append(m_pFolderAttributes[i]);
                    }
                }
                retVal.Append(") ");
                retVal.Append("\"" + m_Delimiter + "\" ");
                retVal.Append(IMAP_Utils.EncodeMailbox(m_FolderName, encoding));
                retVal.Append("\r\n");

                return(retVal.ToString());
            }
        }