Пример #1
0
        /*
         * /// <summary>
         * /// Parses SMTP mailbox from the specified string.
         * /// </summary>
         * /// <param name="value">Mailbox string.</param>
         * /// <returns>Returns parsed SMTP mailbox.</returns>
         * /// <exception cref="ArgumentNullException">Is raised when <b>value</b> is null reference.</exception>
         * public static SMTP_t_Mailbox Parse(string value)
         * {
         *  if(value == null){
         *      throw new ArgumentNullException("value");
         *  }
         *
         *  return Parse(new ABNF_Reader(value));
         * }
         *
         * /// <summary>
         * /// Parses SMTP mailbox from the specified reader.
         * /// </summary>
         * /// <param name="reader">Source reader.</param>
         * /// <returns>Returns parsed SMTP mailbox.</returns>
         * /// <exception cref="ArgumentNullException">Is raised when <b>reader</b> is null reference.</exception>
         * public static SMTP_t_Mailbox Parse(ABNF_Reader reader)
         * {
         *  if(reader == null){
         *      throw new ArgumentNullException("reader");
         *  }
         *
         *  // TODO:
         *
         *  return null;
         * }
         */
        #endregion


        #region override method ToString

        /// <summary>
        /// Returns mailbox as string.
        /// </summary>
        /// <returns>Returns mailbox as string.</returns>
        public override string ToString()
        {
            if (MIME_Reader.IsDotAtom(m_LocalPart))
            {
                return(m_LocalPart + "@" + (Net_Utils.IsIPAddress(m_Domain) ? "[" + m_Domain + "]" : m_Domain));
            }
            else
            {
                return(TextUtils.QuoteString(m_LocalPart) + "@" + (Net_Utils.IsIPAddress(m_Domain) ? "[" + m_Domain + "]" : m_Domain));
            }
        }