示例#1
0
        internal cSinglePartBody(string pType, string pSubType, cSection pSection, cBodyStructureParameters pParameters, string pContentId, cCulturedString pDescription, string pContentTransferEncoding, uint pSizeInBytes, cSinglePartExtensionData pExtensionData) : base(pType, pSubType, pSection)
        {
            Parameters              = pParameters;
            ContentId               = pContentId;
            Description             = pDescription;
            ContentTransferEncoding = pContentTransferEncoding ?? throw new ArgumentNullException(nameof(pContentTransferEncoding));

            if (ContentTransferEncoding.Equals("7BIT", StringComparison.InvariantCultureIgnoreCase))
            {
                DecodingRequired = eDecodingRequired.none;
            }
            else if (ContentTransferEncoding.Equals("8BIT", StringComparison.InvariantCultureIgnoreCase))
            {
                DecodingRequired = eDecodingRequired.none;
            }
            else if (ContentTransferEncoding.Equals("BINARY", StringComparison.InvariantCultureIgnoreCase))
            {
                DecodingRequired = eDecodingRequired.none;
            }
            else if (ContentTransferEncoding.Equals("QUOTED-PRINTABLE", StringComparison.InvariantCultureIgnoreCase))
            {
                DecodingRequired = eDecodingRequired.quotedprintable;
            }
            else if (ContentTransferEncoding.Equals("BASE64", StringComparison.InvariantCultureIgnoreCase))
            {
                DecodingRequired = eDecodingRequired.base64;
            }
            else
            {
                DecodingRequired = eDecodingRequired.other;  // note that rfc 2045 section 6.4 specifies that if 'unknown' then the part has to be treated as application/octet-stream
            }
            SizeInBytes   = pSizeInBytes;
            ExtensionData = pExtensionData;
        }
示例#2
0
        internal cTextBodyPart(string pSubType, cSection pSection, cBodyStructureParameters pParameters, string pContentId, cCulturedString pDescription, string pContentTransferEncoding, uint pSizeInBytes, uint pSizeInLines, cSinglePartExtensionData pExtensionData) : base(kMimeType.Text, pSubType, pSection, pParameters, pContentId, pDescription, pContentTransferEncoding, pSizeInBytes, pExtensionData)
        {
            if (SubType.Equals("PLAIN", StringComparison.InvariantCultureIgnoreCase))
            {
                SubTypeCode = eTextBodyPartSubTypeCode.plain;
            }
            else if (SubType.Equals("HTML", StringComparison.InvariantCultureIgnoreCase))
            {
                SubTypeCode = eTextBodyPartSubTypeCode.html;
            }
            else
            {
                SubTypeCode = eTextBodyPartSubTypeCode.other;
            }

            SizeInLines = pSizeInLines;
        }
示例#3
0
 internal cMessageBodyPart(cSection pSection, cBodyStructureParameters pParameters, string pContentId, cCulturedString pDescription, string pContentTransferEncoding, uint pSizeInBytes, cEnvelope pEnvelope, cBodyPart pBody, cBodyPart pBodyStructure, uint pSizeInLines, cSinglePartExtensionData pExtensionData) : base(kMimeType.Message, kMimeSubType.RFC822, pSection, pParameters, pContentId, pDescription, pContentTransferEncoding, pSizeInBytes, pExtensionData)
 {
     Envelope      = pEnvelope;
     mBody         = pBody;
     BodyStructure = pBodyStructure;
     SizeInLines   = pSizeInLines;
 }