// Token: 0x06001445 RID: 5189 RVA: 0x00074BE4 File Offset: 0x00072DE4
        public virtual void PreProcessProperty()
        {
            Item item = (Item)base.XsoItem;

            if (BodyConversionUtilities.IsMessageRestrictedAndDecoded(item))
            {
                this.actualBody = ((RightsManagedMessageItem)item).ProtectedBody;
            }
            else
            {
                this.actualBody = item.Body;
            }
            this.originalItem      = null;
            this.isIrmErrorMessage = false;
            if (BodyConversionUtilities.IsIRMFailedToDecode(item))
            {
                MessageItem messageItem = this.CreateIrmErrorMessage();
                if (messageItem != null)
                {
                    base.XsoItem           = messageItem;
                    this.originalItem      = item;
                    this.isIrmErrorMessage = true;
                }
            }
        }
        private bool LoadRightsManagementLicenseData(Item mailboxItem, RightsManagementLicenseData rightsManagementLicenseData)
        {
            if (!BodyConversionUtilities.IsMessageRestrictedAndDecoded(mailboxItem) && !BodyConversionUtilities.IsIRMFailedToDecode(mailboxItem))
            {
                return(false);
            }
            if (BodyConversionUtilities.IsIRMFailedToDecode(mailboxItem))
            {
                rightsManagementLicenseData.InitNoRightsTemplate();
                return(true);
            }
            RightsManagedMessageItem rightsManagedMessageItem = mailboxItem as RightsManagedMessageItem;

            rightsManagementLicenseData.EditAllowed               = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Edit));
            rightsManagementLicenseData.ReplyAllowed              = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Reply));
            rightsManagementLicenseData.ReplyAllAllowed           = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.ReplyAll));
            rightsManagementLicenseData.ForwardAllowed            = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Forward));
            rightsManagementLicenseData.PrintAllowed              = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Print));
            rightsManagementLicenseData.ExtractAllowed            = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Extract));
            rightsManagementLicenseData.ProgrammaticAccessAllowed = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.ObjectModel));
            rightsManagementLicenseData.Owner = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Owner));
            if (!AirSyncUtility.IsProtectedVoicemailItem(mailboxItem))
            {
                rightsManagementLicenseData.ExportAllowed = new bool?(rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Export));
            }
            else
            {
                rightsManagementLicenseData.ExportAllowed = new bool?(false);
            }
            if (rightsManagedMessageItem.UsageRights.IsUsageRightGranted(ContentRight.Forward) && (!rightsManagedMessageItem.Restriction.RequiresRepublishingWhenRecipientsChange || rightsManagedMessageItem.CanRepublish))
            {
                rightsManagementLicenseData.ModifyRecipientsAllowed = new bool?(true);
            }
            else
            {
                rightsManagementLicenseData.ModifyRecipientsAllowed = new bool?(false);
            }
            rightsManagementLicenseData.ContentExpiryDate = new ExDateTime?(rightsManagedMessageItem.UserLicenseExpiryTime);
            rightsManagementLicenseData.ContentOwner      = rightsManagedMessageItem.ConversationOwner.EmailAddress;
            RmsTemplate restriction = rightsManagedMessageItem.Restriction;

            if (restriction != null)
            {
                Guid id = restriction.Id;
                rightsManagementLicenseData.TemplateID          = restriction.Id.ToString();
                rightsManagementLicenseData.TemplateName        = restriction.GetName(Command.CurrentCommand.MailboxSession.PreferedCulture);
                rightsManagementLicenseData.TemplateDescription = restriction.GetDescription(Command.CurrentCommand.MailboxSession.PreferedCulture);
            }
            return(true);
        }
        // Token: 0x060013E0 RID: 5088 RVA: 0x00072734 File Offset: 0x00070934
        public IEnumerator <Attachment12Data> GetEnumerator()
        {
            Item             message        = base.XsoItem as Item;
            Attachment12Data attachmentData = null;

            if (message == null)
            {
                throw new UnexpectedTypeException("Item", base.XsoItem);
            }
            MeetingRequest meetingRequest = base.XsoItem as MeetingRequest;

            if (meetingRequest == null || !meetingRequest.IsDelegated())
            {
                string idbase = null;
                if (this.idmapping != null)
                {
                    idbase = this.idmapping[MailboxSyncItemId.CreateForNewItem(message.Id.ObjectId)];
                }
                if (idbase == null)
                {
                    idbase = message.Id.ObjectId.ToBase64String();
                }
                if (message is MessageItem && ((MessageItem)message).IsRestricted && !BodyConversionUtilities.IsMessageRestrictedAndDecoded(message) && !BodyConversionUtilities.IsIRMFailedToDecode(message))
                {
                    object prop = message.TryGetProperty(MessageItemSchema.DRMLicense);
                    if (prop is byte[][])
                    {
                        byte[][] license = (byte[][])prop;
                        if (license.Length > 0)
                        {
                            attachmentData                   = new Attachment14Data();
                            attachmentData.DisplayName       = "message.rpmsg.license";
                            attachmentData.Method            = 1;
                            attachmentData.EstimatedDataSize = (long)license[0].Length;
                            attachmentData.IsInline          = false;
                            attachmentData.FileReference     = HttpUtility.UrlEncode(idbase + ":DRMLicense");
                            AirSyncDiagnostics.TraceDebug(ExTraceGlobals.XsoTracer, this, "Add DRM license as attachment, message is MessageItem {0}, message.IsRestricted {1}, IsDecoded {2}, FailedToDecode {3}", new object[]
                            {
                                message is MessageItem,
                                ((MessageItem)message).IsRestricted,
                                BodyConversionUtilities.IsMessageRestrictedAndDecoded(message),
                                BodyConversionUtilities.IsIRMFailedToDecode(message)
                            });
                            yield return(attachmentData);
                        }
                        else
                        {
                            AirSyncDiagnostics.TraceDebug <int>(ExTraceGlobals.XsoTracer, this, "The license property on the DRM message is incorrect. Length = {0}", license.Length);
                        }
                    }
                    else
                    {
                        AirSyncDiagnostics.TraceDebug(ExTraceGlobals.XsoTracer, this, "The license property on the DRM message is incorrect. prop = {0}", new object[]
                        {
                            prop
                        });
                    }
                }
                AttachmentCollection attachmentCollection = null;
                if (BodyConversionUtilities.IsMessageRestrictedAndDecoded(message))
                {
                    attachmentCollection = ((RightsManagedMessageItem)message).ProtectedAttachmentCollection;
                }
                else
                {
                    if (BodyConversionUtilities.IsIRMFailedToDecode(message))
                    {
                        goto IL_3FC;
                    }
                    attachmentCollection = message.AttachmentCollection;
                }
                int index = -1;
                foreach (AttachmentHandle handle in attachmentCollection)
                {
                    using (Attachment attachment = attachmentCollection.Open(handle))
                    {
                        if (BodyUtility.IsClearSigned(message) && (string.Equals(attachment.FileName, "smime.p7m", StringComparison.OrdinalIgnoreCase) || string.Equals(attachment.ContentType, "multipart/signed", StringComparison.OrdinalIgnoreCase)))
                        {
                            continue;
                        }
                        attachmentData = this.GetAttachmentData(message, attachment, idbase, ref index);
                    }
                    if (attachmentData != null)
                    {
                        yield return(attachmentData);
                    }
                }
            }
IL_3FC:
            yield break;
        }