Beispiel #1
0
 internal void Attachment_Dispose(AttachmentCookie cookie)
 {
     this.ThrowIfDisposed();
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Attachment_Dispose(cookie);
     }
 }
Beispiel #2
0
 internal void Attachment_SetEmbeddedMessage(AttachmentCookie cookie, EmailMessage embeddedMessage)
 {
     this.ThrowIfDisposed();
     this.ThrowIfReadOnly("Attachment_SetEmbeddedMessage");
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Attachment_SetEmbeddedMessage(cookie, embeddedMessage);
     }
 }
Beispiel #3
0
 internal void Attachment_SetFileName(AttachmentCookie cookie, string fileName)
 {
     this.ThrowIfDisposed();
     this.ThrowIfReadOnly("Attachment_SetFileName");
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Attachment_SetFileName(cookie, fileName);
     }
 }
Beispiel #4
0
 internal void Attachment_SetContentDisposition(AttachmentCookie cookie, string contentDisposition)
 {
     this.ThrowIfDisposed();
     this.ThrowIfReadOnly("Attachment_SetContentDisposition");
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Attachment_SetContentDisposition(cookie, contentDisposition);
     }
 }
Beispiel #5
0
 internal void Attachment_SetAttachmentType(AttachmentCookie cookie, InternalAttachmentType attachmentType)
 {
     this.ThrowIfDisposed();
     this.ThrowIfReadOnly("Attachment_SetAttachmentType");
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Attachment_SetAttachmentType(cookie, attachmentType);
     }
 }
Beispiel #6
0
 internal byte[] Attachment_GetAttachRendering(AttachmentCookie cookie)
 {
     this.ThrowIfDisposed();
     byte[] result;
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         result = this.message.Attachment_GetAttachRendering(cookie);
     }
     return(result);
 }
Beispiel #7
0
        internal AttachmentMethod Attachment_GetAttachmentMethod(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            AttachmentMethod result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetAttachmentMethod(cookie);
            }
            return(result);
        }
Beispiel #8
0
        internal EmailMessage Attachment_GetEmbeddedMessage(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            EmailMessage result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetEmbeddedMessage(cookie);
            }
            return(result);
        }
Beispiel #9
0
        internal bool Attachment_GetAttachHidden(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            bool result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetAttachHidden(cookie);
            }
            return(result);
        }
Beispiel #10
0
        internal int Attachment_GetHashCode(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            int result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetHashCode(cookie);
            }
            return(result);
        }
Beispiel #11
0
        internal string Attachment_GetAttachContentLocation(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            string result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetAttachContentLocation(cookie);
            }
            return(result);
        }
Beispiel #12
0
        internal bool Attachment_TryGetContentReadStream(AttachmentCookie cookie, out Stream result)
        {
            this.ThrowIfDisposed();
            bool result2;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result2 = this.message.Attachment_TryGetContentReadStream(cookie, out result);
            }
            return(result2);
        }
Beispiel #13
0
        internal string Attachment_GetFileName(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            string result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetFileName(cookie, ref this.sequenceNumber);
            }
            return(result);
        }
Beispiel #14
0
        internal Stream Attachment_GetContentReadStream(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            Stream result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetContentReadStream(cookie);
            }
            return(result);
        }
Beispiel #15
0
        internal MimePart Attachment_GetMimePart(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            MimePart result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetMimePart(cookie);
            }
            return(result);
        }
Beispiel #16
0
        internal bool AttachmentCollection_RemoveAttachment(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            this.ThrowIfReadOnly("AttachmentCollection_RemoveAttachment");
            bool result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.AttachmentCollection_RemoveAttachment(cookie);
            }
            return(result);
        }
Beispiel #17
0
        public Attachment Add(string fileName, string contentType)
        {
            if (string.IsNullOrEmpty(contentType))
            {
                contentType = "application/octet-stream";
            }
            Attachment       attachment = new Attachment(this.message);
            AttachmentCookie cookie     = this.message.AttachmentCollection_AddAttachment(attachment);

            attachment.Cookie = cookie;
            if (!string.IsNullOrEmpty(fileName))
            {
                this.message.Attachment_SetFileName(cookie, fileName);
            }
            this.message.Attachment_SetContentType(cookie, contentType);
            this.version++;
            return(attachment);
        }
Beispiel #18
0
 public Attachment this[int index]
 {
     get
     {
         if (index < 0)
         {
             throw new ArgumentOutOfRangeException("index");
         }
         if (index > this.Count - 1)
         {
             throw new ArgumentOutOfRangeException("index");
         }
         Attachment attachment = (Attachment)this.message.AttachmentCollection_Indexer(index);
         if (attachment != null)
         {
             return(attachment);
         }
         attachment = new Attachment(this.message);
         AttachmentCookie cookie = this.message.AttachmentCollection_CacheAttachment(index, attachment);
         attachment.Cookie = cookie;
         return(attachment);
     }
 }
 internal abstract bool Attachment_IsAppleDouble(AttachmentCookie cookie);
 internal abstract bool Attachment_TryGetContentReadStream(AttachmentCookie cookie, out Stream result);
 internal abstract int Attachment_GetAttachmentFlags(AttachmentCookie cookie);
 internal abstract void Attachment_SetContentDisposition(AttachmentCookie cookie, string contentDisposition);
 internal abstract int Attachment_GetRenderingPosition(AttachmentCookie cookie);
 internal abstract void Attachment_Dispose(AttachmentCookie cookie);
 internal abstract int Attachment_GetHashCode(AttachmentCookie cookie);
 internal abstract bool Attachment_GetAttachHidden(AttachmentCookie cookie);
 internal abstract string Attachment_GetAttachContentLocation(AttachmentCookie cookie);
 internal abstract byte[] Attachment_GetAttachRendering(AttachmentCookie cookie);
 internal abstract Stream Attachment_GetContentWriteStream(AttachmentCookie cookie);
 internal abstract string Attachment_GetAttachContentID(AttachmentCookie cookie);