Esempio n. 1
0
        internal bool TryGetTnefBinaryCharset(out Charset charset)
        {
            bool result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                PureTnefMessage pureTnefMessage = this.message as PureTnefMessage;
                if (pureTnefMessage == null)
                {
                    MimeTnefMessage mimeTnefMessage = this.message as MimeTnefMessage;
                    if (mimeTnefMessage != null && mimeTnefMessage.HasTnef)
                    {
                        pureTnefMessage = mimeTnefMessage.PureTnefMessage;
                    }
                }
                if (pureTnefMessage != null)
                {
                    charset = pureTnefMessage.BinaryCharset;
                    result  = true;
                }
                else
                {
                    charset = null;
                    result  = false;
                }
            }
            return(result);
        }
Esempio n. 2
0
        internal bool TryGetMapiProperty <T>(TnefPropertyTag propertyTag, out T propValue)
        {
            this.ThrowIfDisposed();
            bool result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                propValue = default(T);
                if (this.message.MapiProperties == null)
                {
                    result = false;
                }
                else
                {
                    object property = this.message.MapiProperties.GetProperty(propertyTag);
                    if (property is T)
                    {
                        propValue = (T)((object)property);
                        result    = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            return(result);
        }
Esempio n. 3
0
 internal void Attachment_Dispose(AttachmentCookie cookie)
 {
     this.ThrowIfDisposed();
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Attachment_Dispose(cookie);
     }
 }
Esempio n. 4
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);
     }
 }
Esempio n. 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);
     }
 }
Esempio n. 6
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);
     }
 }
Esempio n. 7
0
 internal void Normalize(NormalizeOptions normalizeOptions, bool allowUTF8 = false)
 {
     this.ThrowIfDisposed();
     this.ThrowIfReadOnly("Normalize");
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.Normalize(normalizeOptions, allowUTF8);
     }
 }
Esempio n. 8
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);
     }
 }
Esempio n. 9
0
 internal void AttachmentCollection_ClearAttachments()
 {
     this.ThrowIfDisposed();
     this.ThrowIfReadOnly("AttachmentCollection_ClearAttachment");
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         this.message.AttachmentCollection_ClearAttachments();
     }
 }
Esempio n. 10
0
 internal byte[] Attachment_GetAttachRendering(AttachmentCookie cookie)
 {
     this.ThrowIfDisposed();
     byte[] result;
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         result = this.message.Attachment_GetAttachRendering(cookie);
     }
     return(result);
 }
Esempio n. 11
0
        internal Stream Attachment_GetContentReadStream(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            Stream result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetContentReadStream(cookie);
            }
            return(result);
        }
Esempio n. 12
0
        internal int AttachmentCollection_Count()
        {
            this.ThrowIfDisposed();
            int result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.AttachmentCollection_Count();
            }
            return(result);
        }
Esempio n. 13
0
        internal int Attachment_GetHashCode(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            int result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetHashCode(cookie);
            }
            return(result);
        }
Esempio n. 14
0
        internal bool Attachment_GetAttachHidden(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            bool result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetAttachHidden(cookie);
            }
            return(result);
        }
Esempio n. 15
0
        internal object AttachmentCollection_Indexer(int publicIndex)
        {
            this.ThrowIfDisposed();
            object result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.AttachmentCollection_Indexer(publicIndex);
            }
            return(result);
        }
Esempio n. 16
0
        internal AttachmentMethod Attachment_GetAttachmentMethod(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            AttachmentMethod result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetAttachmentMethod(cookie);
            }
            return(result);
        }
Esempio n. 17
0
        internal object GetMapiProperty(TnefPropertyTag tag)
        {
            this.ThrowIfDisposed();
            object mapiProperty;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                mapiProperty = this.message.GetMapiProperty(tag);
            }
            return(mapiProperty);
        }
Esempio n. 18
0
 internal void CopyTo(EmailMessage destination)
 {
     this.ThrowIfDisposed();
     using (ThreadAccessGuard.EnterPublic(this.accessToken))
     {
         using (ThreadAccessGuard.EnterPublic(destination.accessToken))
         {
             this.message.CopyTo(destination.message);
         }
     }
 }
Esempio n. 19
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);
        }
Esempio n. 20
0
        internal MimePart Attachment_GetMimePart(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            MimePart result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetMimePart(cookie);
            }
            return(result);
        }
Esempio n. 21
0
        internal EmailMessage Attachment_GetEmbeddedMessage(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            EmailMessage result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetEmbeddedMessage(cookie);
            }
            return(result);
        }
Esempio n. 22
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);
        }
Esempio n. 23
0
        internal AttachmentCookie AttachmentCollection_CacheAttachment(int publicIndex, object attachment)
        {
            this.ThrowIfDisposed();
            AttachmentCookie result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.AttachmentCollection_CacheAttachment(publicIndex, attachment);
            }
            return(result);
        }
Esempio n. 24
0
        internal string Attachment_GetAttachContentLocation(AttachmentCookie cookie)
        {
            this.ThrowIfDisposed();
            string result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                result = this.message.Attachment_GetAttachContentLocation(cookie);
            }
            return(result);
        }
Esempio n. 25
0
        internal MimePart Body_GetMimePart()
        {
            this.ThrowIfDisposed();
            MimePart mimePart;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                IBody body = this.message.GetBody();
                mimePart = body.GetMimePart();
            }
            return(mimePart);
        }
Esempio n. 26
0
        internal BodyFormat Body_GetBodyFormat()
        {
            this.ThrowIfDisposed();
            BodyFormat bodyFormat;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                IBody body = this.message.GetBody();
                bodyFormat = body.GetBodyFormat();
            }
            return(bodyFormat);
        }
Esempio n. 27
0
        internal string Body_GetCharsetName()
        {
            this.ThrowIfDisposed();
            string charsetName;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                IBody body = this.message.GetBody();
                charsetName = body.GetCharsetName();
            }
            return(charsetName);
        }
Esempio n. 28
0
        internal Stream Body_GetContentReadStream()
        {
            this.ThrowIfDisposed();
            Stream contentReadStream;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                IBody body = this.message.GetBody();
                contentReadStream = body.GetContentReadStream();
            }
            return(contentReadStream);
        }
Esempio n. 29
0
        internal bool Body_TryGetContentReadStream(out Stream stream)
        {
            this.ThrowIfDisposed();
            bool result;

            using (ThreadAccessGuard.EnterPublic(this.accessToken))
            {
                IBody body = this.message.GetBody();
                result = body.TryGetContentReadStream(out stream);
            }
            return(result);
        }
Esempio n. 30
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);
        }