/// <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; }