コード例 #1
0
ファイル: Attachment.cs プロジェクト: fabsenet/EESSI-AS4.NET
        /// <summary>
        /// Updates both the content and the type of the content in the <see cref="Attachment"/>.
        /// </summary>
        /// <param name="content"></param>
        /// <param name="contentType"></param>
        public void UpdateContent(Stream content, string contentType)
        {
            if (ReferenceEquals(Content, content) == false)
            {
                Content?.Dispose();
            }

            Content     = content;
            ContentType = contentType;

            EstimatedContentSize =
                Content != null
                    ? StreamUtilities.GetStreamSize(Content)
                    : -1;
        }