Example #1
0
        /// <inheritdoc />
        public override Attachment Normalize()
        {
            string normalizedName        = MarkupNormalizationUtils.NormalizeAttachmentName(Name);
            string normalizedContentType = MarkupNormalizationUtils.NormalizeContentType(ContentType);

            if (ReferenceEquals(Name, normalizedName) &&
                ReferenceEquals(ContentType, normalizedContentType))
            {
                return(this);
            }

            return(new BinaryAttachment(normalizedName, normalizedContentType, bytes));
        }
Example #2
0
        /// <inheritdoc />
        public override Attachment Normalize()
        {
            string normalizedName        = MarkupNormalizationUtils.NormalizeAttachmentName(Name);
            string normalizedContentType = MarkupNormalizationUtils.NormalizeContentType(ContentType);
            string normalizedText        = MarkupNormalizationUtils.NormalizeText(text);

            if (ReferenceEquals(Name, normalizedName) &&
                ReferenceEquals(ContentType, normalizedContentType) &&
                ReferenceEquals(text, normalizedText))
            {
                return(this);
            }

            return(new TextAttachment(normalizedName, normalizedContentType, text));
        }