Exemplo n.º 1
0
        internal EncodingOptions GetDocumentEncodingOptions()
        {
            MimeDocument mimeDocument;
            MimeNode     mimeNode;

            this.GetMimeDocumentOrTreeRoot(out mimeDocument, out mimeNode);
            if (mimeDocument != null)
            {
                return(mimeDocument.EncodingOptions);
            }
            MimePart mimePart = mimeNode as MimePart;

            return(new EncodingOptions((mimePart == null) ? null : mimePart.FindMimeTreeCharset()));
        }
Exemplo n.º 2
0
        internal Charset GetDefaultHeaderDecodingCharset(MimeDocument document, MimeNode treeRoot)
        {
            if (treeRoot == null)
            {
                this.GetMimeDocumentOrTreeRoot(out document, out treeRoot);
            }
            Charset charset;

            if (document != null)
            {
                charset = document.EffectiveHeaderDecodingOptions.Charset;
            }
            else
            {
                MimePart mimePart = treeRoot as MimePart;
                charset = ((mimePart == null) ? null : mimePart.FindMimeTreeCharset());
            }
            if (charset == null)
            {
                charset = DecodingOptions.DefaultCharset;
            }
            return(charset);
        }