Exemplo n.º 1
0
 protected override void PromoteAttachDataObject()
 {
     if (this.PropertyReader.AttachMethod == 5)
     {
         using (MsgStorageReader embeddedMessageReader = this.PropertyReader.GetEmbeddedMessageReader())
         {
             using (InboundMessageWriter inboundMessageWriter = base.MessageWriter.OpenAttachedMessageWriter())
             {
                 InboundMsgConverter inboundMsgConverter = new InboundMsgConverter(inboundMessageWriter);
                 inboundMsgConverter.InternalConvertToItem(embeddedMessageReader);
                 inboundMessageWriter.Commit();
             }
             return;
         }
     }
     if (this.PropertyReader.AttachMethod == 6)
     {
         using (Stream valueReadStream = this.PropertyReader.GetValueReadStream())
         {
             using (Stream stream = base.MessageWriter.OpenOleAttachmentDataStream())
             {
                 Util.StreamHandler.CopyStreamData(valueReadStream, stream);
             }
         }
     }
 }
Exemplo n.º 2
0
        internal MessageAttachmentWriter(InboundMessageWriter messageWriter, int attachMethod)
        {
            StorageGlobals.TraceConstructIDisposable(this);
            this.messageWriter = messageWriter;
            AttachmentType attachmentType = CoreAttachmentCollection.GetAttachmentType(new int?(attachMethod));

            this.coreAttachment = this.CoreItem.AttachmentCollection.Create(attachmentType);
        }
Exemplo n.º 3
0
 internal MessageAttachmentWriter(InboundMessageWriter messageWriter)
 {
     StorageGlobals.TraceConstructIDisposable(this);
     this.disposeTracker = this.GetDisposeTracker();
     this.messageWriter  = messageWriter;
     this.coreAttachment = this.CoreItem.AttachmentCollection.InternalCreate(null);
     this.attachMethod   = null;
 }
Exemplo n.º 4
0
        private InboundMessageWriter(InboundMessageWriter parent, ICoreItem item)
        {
            StorageGlobals.TraceConstructIDisposable(this);
            this.disposeTracker    = this.GetDisposeTracker();
            this.parent            = parent;
            this.isTopLevelMessage = false;
            this.SetItem(item, parent.ConversionOptions, true);
            ConversionLimitsTracker conversionLimitsTracker = parent.LimitsTracker;

            conversionLimitsTracker.StartEmbeddedMessage();
            InboundAddressCache addressCache = new InboundAddressCache(parent.ConversionOptions, conversionLimitsTracker, MimeMessageLevel.AttachedMessage);

            this.SetAddressCache(addressCache, true);
            this.SetLimitsTracker(conversionLimitsTracker);
            this.componentType = ConversionComponentType.Message;
        }
Exemplo n.º 5
0
        internal InboundMessageWriter OpenAttachedMessageWriter()
        {
            this.CheckDisposed("OpenAttachedMessage");
            ICoreItem            coreItem             = null;
            InboundMessageWriter inboundMessageWriter = null;

            try
            {
                coreItem             = this.attachment.CreateAttachmentItem();
                inboundMessageWriter = new InboundMessageWriter(this, coreItem);
            }
            finally
            {
                if (inboundMessageWriter == null && coreItem != null)
                {
                    coreItem.Dispose();
                    coreItem = null;
                }
            }
            return(inboundMessageWriter);
        }
 protected override void PromoteAttachDataObject()
 {
     if (this.PropertyReader.IsEmbeddedMessage)
     {
         using (TnefReader embeddedMessageReader = this.PropertyReader.GetEmbeddedMessageReader())
         {
             using (InboundMessageWriter inboundMessageWriter = base.MessageWriter.OpenAttachedMessageWriter())
             {
                 if (this.IsReplicationMessage)
                 {
                     inboundMessageWriter.ForceParticipantResolution = this.ResolveParticipantsOnAttachments;
                 }
                 else
                 {
                     inboundMessageWriter.ForceParticipantResolution = base.ConversionOptions.ResolveRecipientsInAttachedMessages;
                 }
                 new InboundTnefConverter(inboundMessageWriter)
                 {
                     IsReplicationMessage = this.IsReplicationMessage
                 }.ConvertToItem(embeddedMessageReader, this.isSummaryTnef);
                 inboundMessageWriter.Commit();
             }
             return;
         }
     }
     if (this.PropertyReader.ObjectIid == MimeConstants.IID_IStorage)
     {
         using (Stream rawValueReadStream = this.PropertyReader.GetRawValueReadStream())
         {
             using (Stream stream = base.MessageWriter.OpenOleAttachmentDataStream())
             {
                 Util.StreamHandler.CopyStreamData(rawValueReadStream, stream, null, 0, 131072);
             }
         }
     }
 }
 internal InboundTnefConverter(InboundMessageWriter writer) : base(writer, new AbstractInboundConverter.TransmittablePropertyPromotionRule())
 {
 }
Exemplo n.º 8
0
 internal InboundMsgConverter(InboundMessageWriter writer) : base(writer, new AbstractInboundConverter.WriteablePropertyPromotionRule())
 {
 }
 protected AbstractInboundConverter(InboundMessageWriter writer, AbstractInboundConverter.IPromotionRule defaultPromotionRule)
 {
     this.messageWriter        = writer;
     this.defaultPromotionRule = defaultPromotionRule;
 }