Пример #1
0
 /// <summary>
 /// Returns header field as string.
 /// </summary>
 /// <param name="wordEncoder">8-bit words ecnoder. Value null means that words are not encoded.</param>
 /// <param name="parmetersCharset">Charset to use to encode 8-bit characters. Value null means parameters not encoded.</param>
 /// <param name="reEncode">If true always specified encoding is used. If false and header field value not modified, original encoding is kept.</param>
 /// <returns>Returns header field as string.</returns>
 public override string ToString(MIME_Encoding_EncodedWord wordEncoder, Encoding parmetersCharset, bool reEncode)
 {
     if (reEncode || this.IsModified)
     {
         return("Content-Disposition: " + m_DispositionType + m_pParameters.ToString(parmetersCharset) + "\r\n");
     }
     else
     {
         return(m_ParseValue);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns header field as string.
        /// </summary>
        /// <param name="wordEncoder">8-bit words ecnoder. Value null means that words are not encoded.</param>
        /// <param name="parmetersCharset">Charset to use to encode 8-bit characters. Value null means parameters not encoded.</param>
        /// <param name="reEncode">If true always specified encoding is used. If false and header field value not modified, original encoding is kept.</param>
        /// <returns>Returns header field as string.</returns>
        public override string ToString(MIME_Encoding_EncodedWord wordEncoder, Encoding parmetersCharset, bool reEncode)
        {
            if (!reEncode && !this.IsModified)
            {
                return(m_ParseValue);
            }
            else
            {
                StringBuilder retVal = new StringBuilder();
                retVal.Append("Content-Type: " + m_Type + "/" + m_SubType);
                retVal.Append(m_pParameters.ToString(parmetersCharset));
                retVal.Append("\r\n");

                return(retVal.ToString());
            }
        }