protected override byte[] MessageSaveChanges(StorageFxProxyPool.MessageEntry entry) { CoreItem referencedObject = entry.WrappedObject.ReferenceCoreItem.ReferencedObject; if (entry.MimeStream != null || entry.CachedItemProperties.Count > 0) { using (Item item = new Item(referencedObject, true)) { if (entry.MimeStream != null) { InboundConversionOptions scopedInboundConversionOptions = MapiUtils.GetScopedInboundConversionOptions(this.destMailbox.StoreSession.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid)); using (entry.MimeStream) { ItemConversion.ConvertAnyMimeToItem(item, entry.MimeStream, scopedInboundConversionOptions); } } foreach (ItemPropertiesBase itemPropertiesBase in entry.CachedItemProperties) { itemPropertiesBase.Apply((MailboxSession)this.destMailbox.StoreSession, item); } } } if (entry.CachedPropValues.Count > 0) { this.SetProps(entry.WrappedObject.PropertyBag, entry.CachedPropValues.ToArray()); } entry.WrappedObject.Save(); referencedObject.PropertyBag.Load(StorageFxProxyPool.EntryIdPropDef); return(referencedObject.PropertyBag[StorageFxProxyPool.EntryIdPropDef[0]] as byte[]); }
public override void Apply(MailboxSession session, Item item) { if (string.IsNullOrEmpty(this.ICalContents)) { return; } InboundConversionOptions scopedInboundConversionOptions = MapiUtils.GetScopedInboundConversionOptions(session.GetADRecipientSession(true, ConsistencyMode.IgnoreInvalid)); ItemConversion.ConvertICalToItem(item, scopedInboundConversionOptions, this.ICalContents); }