示例#1
0
        // Token: 0x060004BA RID: 1210 RVA: 0x00027480 File Offset: 0x00025680
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string action = this.Action;

            if (Utilities.IsPostRequest(base.Request) && string.Equals(action, "Delete", StringComparison.Ordinal))
            {
                this.isBeingCanceled = true;
            }
            CalendarItemBase calendarItemBase = base.OwaContext.PreFormActionData as CalendarItemBase;

            this.folderId = EditCalendarItemHelper.GetCalendarFolderId(base.Request, base.UserContext);
            if (calendarItemBase != null)
            {
                this.CalendarItemBase             = calendarItemBase;
                base.OwaContext.PreFormActionData = null;
            }
            else
            {
                this.LoadCalendarItem(this.folderId);
                bool flag = string.Equals(action, "New", StringComparison.Ordinal) && string.IsNullOrEmpty(Utilities.GetQueryStringParameter(base.Request, "id", false));
                if (flag)
                {
                    bool isMeeting = Utilities.GetQueryStringParameter(base.Request, "mr", false) != null;
                    this.CalendarItemBase.IsMeeting = isMeeting;
                }
            }
            if (Utilities.GetQueryStringParameter(base.Request, "sndpt", false) != null)
            {
                CalendarItemUtilities.BuildSendConfirmDialogPrompt(this.calendarItemBase, out this.sendIssuesPrompt);
            }
            if (!this.IsUnsaved && !this.isBeingCanceled)
            {
                CalendarUtilities.AddCalendarInfobarMessages(base.Infobar, this.CalendarItemBase, null, base.UserContext);
            }
            if (!this.IsUnsaved && this.IsOccurrence && !this.isBeingCanceled && this.CalendarItemBase.IsOrganizer())
            {
                SanitizedHtmlString messageHtml = SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(538626087), new object[]
                {
                    "<a href=\"#\" onClick=\"return onClkES()\">",
                    "</a>"
                });
                base.Infobar.AddMessageHtml(messageHtml, InfobarMessageType.Informational);
            }
            this.recipientWell = new CalendarItemRecipientWell(base.UserContext, this.CalendarItemBase);
            this.toolbar       = new EditCalendarItemToolbar(this.IsUnsaved, this.IsMeeting, this.CalendarItemBase.MeetingRequestWasSent, this.CalendarItemBase.Importance, this.CalendarItemBase.CalendarItemType, base.Response.Output, true, this.isBeingCanceled);
            base.CreateAttachmentHelpers(AttachmentWellType.ReadWrite);
            CalendarModuleViewState calendarModuleViewState = base.UserContext.LastClientViewState as CalendarModuleViewState;

            if (calendarModuleViewState != null)
            {
                this.lastAccessedYear = calendarModuleViewState.DateTime.Year;
            }
        }
        // Token: 0x06000575 RID: 1397 RVA: 0x0002B488 File Offset: 0x00029688
        private void MeetingPageWriterFactory(string itemType, EventArgs e)
        {
            if (ObjectClass.IsMeetingRequest(itemType))
            {
                MeetingRequest meetingRequest = base.Item = base.Initialize <MeetingRequest>(MeetingInviteWriter.PrefetchProperties);
                this.delegateMessage   = 1491510515;
                this.meetingPageWriter = new MeetingInviteWriter(meetingRequest, base.UserContext, base.IsEmbeddedItem);
                if (meetingRequest.MeetingRequestType == MeetingMessageType.Outdated)
                {
                    base.Infobar.AddMessageLocalized(1771878760, InfobarMessageType.Informational);
                }
                else if (this.meetingPageWriter.CalendarItemBase != null)
                {
                    CalendarUtilities.AddCalendarInfobarMessages(base.Infobar, this.meetingPageWriter.CalendarItemBase, meetingRequest, base.UserContext);
                }
            }
            else if (ObjectClass.IsMeetingCancellation(itemType))
            {
                MeetingCancellation meetingCancellation = base.Item = base.Initialize <MeetingCancellation>(MeetingCancelWriter.PrefetchProperties);
                this.delegateMessage   = 1953915685;
                this.meetingPageWriter = new MeetingCancelWriter(meetingCancellation, base.UserContext, base.IsEmbeddedItem);
                if (MeetingUtilities.MeetingCancellationIsOutOfDate(meetingCancellation))
                {
                    base.Infobar.AddMessageLocalized(21101307, InfobarMessageType.Informational);
                }
                else
                {
                    base.Infobar.AddMessageLocalized(-161808760, InfobarMessageType.Informational);
                }
            }
            else if (ObjectClass.IsCalendarItemCalendarItemOccurrenceOrRecurrenceException(itemType))
            {
                this.isCalendarItem = true;
                CalendarItemBase calendarItemBase = base.Item = base.Initialize <CalendarItemBase>(MeetingPageWriter.CalendarPrefetchProperties);
                this.meetingPageWriter = new CalendarItemWriter(calendarItemBase, base.UserContext);
                if (calendarItemBase != null)
                {
                    CalendarUtilities.AddCalendarInfobarMessages(base.Infobar, this.meetingPageWriter.CalendarItemBase, null, base.UserContext);
                }
            }
            else
            {
                if (!ObjectClass.IsMeetingResponse(itemType))
                {
                    ExTraceGlobals.CalendarCallTracer.TraceDebug <string>((long)this.GetHashCode(), "Unsupported item type '{0}' for meeting page", itemType);
                    throw new OwaInvalidRequestException(string.Format("Unsupported item type '{0}' for edit meeting page", itemType));
                }
                this.isMeetingResponse = true;
                MeetingResponse meetingResponse = base.Item = base.Initialize <MeetingResponse>(MeetingResponseWriter.PrefetchProperties);
                this.delegateMessage   = -1986433227;
                this.meetingPageWriter = new MeetingResponseWriter(meetingResponse, base.UserContext, base.IsEmbeddedItem);
                if (meetingResponse.From != null)
                {
                    string messageText = string.Empty;
                    switch (meetingResponse.ResponseType)
                    {
                    case ResponseType.Tentative:
                        messageText = string.Format(LocalizedStrings.GetNonEncoded(-67265594), meetingResponse.From.DisplayName);
                        break;

                    case ResponseType.Accept:
                        messageText = string.Format(LocalizedStrings.GetNonEncoded(1335319405), meetingResponse.From.DisplayName);
                        break;

                    case ResponseType.Decline:
                        messageText = string.Format(LocalizedStrings.GetNonEncoded(-1091863618), meetingResponse.From.DisplayName);
                        break;
                    }
                    base.Infobar.AddMessageText(messageText, InfobarMessageType.Informational);
                }
            }
            if (!this.isCalendarItem)
            {
                this.isDelegated = ((MeetingMessage)base.Item).IsDelegated();
            }
            this.CurrentFolderStoreObjectId = (base.IsEmbeddedItem ? base.ParentItem.ParentId : base.Item.ParentId);
            this.navigationModule           = Navigation.GetNavigationModuleFromFolder(base.UserContext, this.CurrentFolderStoreObjectId);
        }