Example #1
0
        protected void CreateAttachmentHelpers(AttachmentWellType wellType)
        {
            if (JunkEmailUtilities.IsJunkOrPhishing(this.Item, this.IsEmbeddedItem, base.UserContext))
            {
                this.shouldRenderAttachmentWell = false;
                return;
            }
            this.attachmentWellRenderObjects = AttachmentWell.GetAttachmentInformation(this.Item, this.AttachmentLinks, base.UserContext.IsPublicLogon, this.IsEmbeddedItem);
            if (this.attachmentWellRenderObjects != null && this.attachmentWellRenderObjects.Count > 0 && Utilities.IsClearSigned(this.Item))
            {
                AttachmentUtility.RemoveSmimeAttachment(this.attachmentWellRenderObjects);
            }
            if (this.Item is Contact)
            {
                OwaForm.RemoveContactPhoto(this.attachmentWellRenderObjects);
            }
            InfobarRenderingHelper infobarRenderingHelper = new InfobarRenderingHelper(this.attachmentWellRenderObjects);

            if (wellType == AttachmentWellType.ReadOnly && infobarRenderingHelper.HasLevelOneAndBlock)
            {
                this.infobar.AddMessageText(string.Format(CultureInfo.InvariantCulture, LocalizedStrings.GetNonEncoded(-824680214), new object[]
                {
                    infobarRenderingHelper.FileNameStringForLevelOneAndBlock
                }), InfobarMessageType.Informational);
            }
            else if (wellType != AttachmentWellType.ReadOnly && infobarRenderingHelper.HasLevelOneAndBlock)
            {
                this.infobar.AddMessageLocalized(-2118248931, InfobarMessageType.Informational);
            }
            bool flag = AttachmentUtility.IsOutLine(this.attachmentWellRenderObjects);

            this.shouldRenderAttachmentWell = (wellType == AttachmentWellType.ReadWrite || (flag && wellType == AttachmentWellType.ReadOnly && (infobarRenderingHelper.HasLevelTwo || infobarRenderingHelper.HasLevelThree || infobarRenderingHelper.HasWebReadyFirst)));
        }
        // Token: 0x0600042F RID: 1071 RVA: 0x00023760 File Offset: 0x00021960
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (base.OwaContext.FormsRegistryContext.Action != null)
            {
                this.action = base.OwaContext.FormsRegistryContext.Action;
            }
            if (string.IsNullOrEmpty(this.action))
            {
                this.messageIdString = Utilities.GetQueryStringParameter(base.Request, "id", true);
                this.changeKeyString = null;
            }
            else
            {
                this.messageIdString = Utilities.GetFormParameter(base.Request, "hidid", true);
                this.changeKeyString = Utilities.GetFormParameter(base.Request, "hidchk", true);
            }
            this.GetItem();
            string a;

            if ((a = this.action) != null)
            {
                if (!(a == "Add"))
                {
                    if (a == "Del")
                    {
                        if (Utilities.GetFormParameter(base.Request, "dLst", false) != null)
                        {
                            this.RemoveAttachments();
                        }
                    }
                }
                else
                {
                    this.AddAttachments();
                }
            }
            this.attachmentList = AttachmentWell.GetAttachmentInformation(base.Item, base.AttachmentLinks, base.UserContext.IsPublicLogon);
            if (base.Item is Contact)
            {
                OwaForm.RemoveContactPhoto(this.attachmentList);
            }
            CalendarItemBaseData userContextData = EditCalendarItemHelper.GetUserContextData(base.UserContext);

            if (userContextData != null && userContextData.Id != null && !string.IsNullOrEmpty("hidchk") && userContextData.Id.Equals(base.Item.Id.ObjectId) && userContextData.ChangeKey != this.changeKeyString)
            {
                userContextData.ChangeKey = this.changeKeyString;
            }
            this.levelOneFound = AttachmentUtility.IsLevelOneAndBlock(this.attachmentList);
        }