// Token: 0x0600071C RID: 1820 RVA: 0x00037B9C File Offset: 0x00035D9C
        private void ProcessAttachment(Attachment attachment, HttpContext httpContext, BlockStatus blockStatus)
        {
            if (attachment == null)
            {
                throw new ArgumentNullException("attachment");
            }
            OwaContext  owaContext  = OwaContext.Get(httpContext);
            UserContext userContext = owaContext.UserContext;
            Stream      stream      = null;

            try
            {
                StreamAttachmentBase streamAttachment = AttachmentUtility.GetStreamAttachment(attachment);
                if (streamAttachment == null)
                {
                    ExTraceGlobals.AttachmentHandlingTracer.TraceError((long)this.GetHashCode(), "AttachmentHandler.ProcessAttachment: attachment is not derived from AttachmentStream");
                }
                else
                {
                    AttachmentPolicy.Level attachmentLevel = AttachmentLevelLookup.GetAttachmentLevel(streamAttachment, userContext);
                    if (attachmentLevel == AttachmentPolicy.Level.Block)
                    {
                        Utilities.TransferToErrorPage(owaContext, LocalizedStrings.GetNonEncoded(-2000404449), LocalizedStrings.GetNonEncoded(-615885395));
                    }
                    else
                    {
                        string fileName = AttachmentUtility.CalculateAttachmentName(streamAttachment.DisplayName, streamAttachment.FileName);
                        string text     = streamAttachment.FileExtension;
                        if (text == null)
                        {
                            text = string.Empty;
                        }
                        string empty       = string.Empty;
                        bool   contentType = this.GetContentType(httpContext, streamAttachment, attachmentLevel, out empty);
                        bool   isInline    = this.GetIsInline(streamAttachment, attachmentLevel);
                        stream = AttachmentUtility.GetStream(streamAttachment);
                        if (stream == null)
                        {
                            ExTraceGlobals.AttachmentHandlingTracer.TraceError((long)this.GetHashCode(), "AttachmentHandler.ProcessAttachment: Image conversion of OLE attachment failure");
                        }
                        else
                        {
                            AttachmentHandler.SendDocumentContentToHttpStream(httpContext, stream, fileName, text, empty, isInline, streamAttachment.TextCharset, blockStatus, attachmentLevel, contentType);
                        }
                    }
                }
            }
            finally
            {
                if (stream != null)
                {
                    stream.Dispose();
                }
            }
        }