private string GetOrGenerateAttachContentId(AttachmentLink link) { string text = link.ContentId; if (string.IsNullOrEmpty(text)) { text = AttachmentLink.CreateContentId(this.AttachmentCollection.ContainerItem, link.AttachmentId, this.contentIdDomain); link.ContentId = text; } return(text); }
internal static ReadOnlyCollection <AttachmentLink> ItemToICal(Item item, ReadOnlyCollection <AttachmentLink> existingAttachmentLinks, OutboundAddressCache addressCache, Stream stream, string charsetName, OutboundConversionOptions outboundConversionOptions) { ReadOnlyCollection <AttachmentLink> readOnlyCollection = AttachmentLink.MergeAttachmentLinks(existingAttachmentLinks, item.AttachmentCollection.CoreAttachmentCollection); foreach (AttachmentLink attachmentLink in readOnlyCollection) { if (string.IsNullOrEmpty(attachmentLink.ContentId)) { attachmentLink.ContentId = AttachmentLink.CreateContentId(item.CoreItem, attachmentLink.AttachmentId, outboundConversionOptions.ImceaEncapsulationDomain); } } return(CalendarDocument.InternalItemsToICal(null, new Item[] { item }, readOnlyCollection, addressCache, false, stream, new List <LocalizedString>(), charsetName, outboundConversionOptions)); }