コード例 #1
0
 internal void BuildInfobar(Infobar infobar)
 {
     if (this.IsPhishingItemWithEnabledLinks())
     {
         string s = "<a id=\"aIbBlk\" href=\"#\" " + string.Format(CultureInfo.InvariantCulture, ">{0}</a> {1} ", new object[]
         {
             LocalizedStrings.GetHtmlEncoded(-672110188),
             LocalizedStrings.GetHtmlEncoded(-1020475744)
         });
         string s2 = string.Format(CultureInfo.InvariantCulture, "<a href=\"#\" " + Utilities.GetScriptHandler("onclick", "opnHlp(\"" + Utilities.JavascriptEncode(Utilities.BuildEhcHref(HelpIdsLight.EmailSafetyLight.ToString())) + "\");") + ">{0}</a>", new object[]
         {
             LocalizedStrings.GetHtmlEncoded(338562664)
         });
         infobar.AddMessage(SanitizedHtmlString.Format("{0}{1}{2}", new object[]
         {
             LocalizedStrings.GetNonEncoded(1581910613),
             SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s),
             SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s2)
         }), InfobarMessageType.Phishing);
     }
     if (this.isDelegated)
     {
         infobar.AddMessage(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(-1205864060), new object[]
         {
             MeetingUtilities.GetReceivedOnBehalfOfDisplayName(this.meetingRequest)
         }), InfobarMessageType.Informational);
     }
     if (this.meetingRequest.MeetingRequestType == MeetingMessageType.PrincipalWantsCopy)
     {
         infobar.AddMessage(SanitizedHtmlString.FromStringId(-332743944), InfobarMessageType.Informational);
     }
     if (!this.IsDraft && this.meetingRequest.MeetingRequestType != MeetingMessageType.Outdated && this.CalendarItemBase != null)
     {
         CalendarUtilities.AddCalendarInfobarMessages(infobar, this.CalendarItemBase, this.meetingRequest, this.UserContext);
     }
     if (this.infobarResponseString != null)
     {
         infobar.AddMessage(this.infobarResponseString.Value, InfobarMessageType.Informational);
     }
 }
コード例 #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.infobar.SetInfobarClass("infobarEdit");
            this.infobar.SetShouldHonorHideByDefault(true);
            this.calendarItemBase = base.Initialize <CalendarItemBase>(false, new PropertyDefinition[]
            {
                CalendarItemBaseSchema.CalendarItemType,
                StoreObjectSchema.EffectiveRights
            });
            if (this.calendarItemBase != null)
            {
                if (string.Equals(base.OwaContext.FormsRegistryContext.Action, "Open", StringComparison.OrdinalIgnoreCase))
                {
                    this.newItemType = NewItemType.ExplicitDraft;
                }
                else
                {
                    this.newItemType         = NewItemType.ImplicitDraft;
                    base.DeleteExistingDraft = true;
                }
            }
            else
            {
                this.calendarItemBase = Utilities.CreateDraftMeetingRequestFromQueryString(base.UserContext, base.Request, new PropertyDefinition[]
                {
                    StoreObjectSchema.EffectiveRights
                });
                if (this.calendarItemBase != null)
                {
                    this.newItemType         = NewItemType.ImplicitDraft;
                    base.DeleteExistingDraft = true;
                    base.Item = this.calendarItemBase;
                }
            }
            if (this.calendarItemBase != null)
            {
                this.isMeeting = this.calendarItemBase.IsMeeting;
                this.startTime = this.calendarItemBase.StartTime;
                this.endTime   = this.calendarItemBase.EndTime;
                if (this.calendarItemBase.IsAllDayEvent && !this.IsRecurringMaster)
                {
                    this.endTime = this.endTime.IncrementDays(-1);
                }
                this.recipientWell       = new CalendarItemRecipientWell(this.calendarItemBase);
                this.bodyMarkup          = BodyConversionUtilities.GetBodyFormatOfEditItem(this.calendarItemBase, this.newItemType, base.UserContext.UserOptions);
                this.toolbar             = new EditCalendarItemToolbar(this.calendarItemBase, this.isMeeting, this.bodyMarkup, this.IsPublicItem);
                this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
                this.isBeingCanceled     = (Utilities.GetQueryStringParameter(base.Request, "c", false) != null);
                string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "er", false);
                if (queryStringParameter != null)
                {
                    if (this.calendarItemBase.CalendarItemType != CalendarItemType.RecurringMaster || !(this.calendarItemBase is CalendarItem))
                    {
                        throw new OwaInvalidRequestException("Invalid calendar item type.  Only recurring masters support specifying an end range");
                    }
                    this.endRange = ExDateTime.MinValue;
                    try
                    {
                        this.endRange = DateTimeUtilities.ParseIsoDate(queryStringParameter, base.UserContext.TimeZone);
                    }
                    catch (OwaParsingErrorException)
                    {
                        ExTraceGlobals.CalendarDataTracer.TraceDebug <string>((long)this.GetHashCode(), "Invalid end range provided on URL '{0}'", queryStringParameter);
                        throw new OwaInvalidRequestException(string.Format("Invalid end range provided on URL '{0}'", queryStringParameter));
                    }
                    if (this.endRange != ExDateTime.MinValue)
                    {
                        CalendarItem calendarItem = (CalendarItem)this.calendarItemBase;
                        this.occurrenceCount = MeetingUtilities.CancelRecurrence(calendarItem, this.endRange);
                        if (this.occurrenceCount == 0)
                        {
                            this.isBeingCanceled = true;
                        }
                    }
                }
                string queryStringParameter2 = Utilities.GetQueryStringParameter(base.Request, "od", false);
                if (queryStringParameter2 != null)
                {
                    try
                    {
                        this.occurrenceDate = DateTimeUtilities.ParseIsoDate(queryStringParameter2, base.UserContext.TimeZone).Date;
                        goto IL_303;
                    }
                    catch (OwaParsingErrorException)
                    {
                        ExTraceGlobals.CalendarDataTracer.TraceDebug <string>((long)this.GetHashCode(), "Invalid occurrence date specified on URL '{0}'", queryStringParameter2);
                        throw new OwaInvalidRequestException(string.Format("Invalid occurrence date provided on URL '{0}'", queryStringParameter2));
                    }
                }
                this.occurrenceDate = DateTimeUtilities.GetLocalTime().Date;
IL_303:
                CalendarUtilities.AddCalendarInfobarMessages(this.infobar, this.calendarItemBase, null, base.UserContext);
                if (this.isBeingCanceled)
                {
                    this.infobar.AddMessage(SanitizedHtmlString.FromStringId(1328030972), InfobarMessageType.Informational);
                }
                this.disableOccurrenceReminderUI = MeetingUtilities.CheckShouldDisableOccurrenceReminderUI(this.calendarItemBase);
                if (this.disableOccurrenceReminderUI && !this.IsPublicItem)
                {
                    this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-891369593), InfobarMessageType.Informational);
                }
                if (!(this.calendarItemBase is CalendarItem))
                {
                    this.recurrenceUtilities = new RecurrenceUtilities(null, base.SanitizingResponse);
                    return;
                }
                if (0 < this.occurrenceCount)
                {
                    EndDateRecurrenceRange range = new EndDateRecurrenceRange(((CalendarItem)this.calendarItemBase).Recurrence.Range.StartDate, this.endRange.IncrementDays(-1));
                    this.recurrenceUtilities = new RecurrenceUtilities(new Recurrence(((CalendarItem)this.calendarItemBase).Recurrence.Pattern, range), base.SanitizingResponse);
                    return;
                }
                this.recurrenceUtilities = new RecurrenceUtilities(((CalendarItem)this.calendarItemBase).Recurrence, base.SanitizingResponse);
                return;
            }
            else
            {
                this.isMeeting = (Utilities.GetQueryStringParameter(base.Request, "mr", false) != null);
                if (this.isMeeting && this.IsPublicItem)
                {
                    throw new OwaInvalidRequestException("Can't create meeting in Owa Public Folders");
                }
                this.isAllDayEvent = (Utilities.GetQueryStringParameter(base.Request, "evt", false) != null);
                bool   flag = Utilities.GetQueryStringParameter(base.Request, "tm", false) != null || this.isAllDayEvent;
                string queryStringParameter3 = Utilities.GetQueryStringParameter(base.Request, "st", false);
                if (queryStringParameter3 != null)
                {
                    try
                    {
                        this.startTime = DateTimeUtilities.ParseIsoDate(queryStringParameter3, base.UserContext.TimeZone);
                    }
                    catch (OwaParsingErrorException)
                    {
                        ExTraceGlobals.CalendarDataTracer.TraceDebug <string>((long)this.GetHashCode(), "Invalid start date provided on URL '{0}'", queryStringParameter3);
                        throw new OwaInvalidRequestException(string.Format("Invalid start date provided on URL '{0}'", queryStringParameter3));
                    }
                }
                if (flag || this.startTime == ExDateTime.MinValue)
                {
                    ExDateTime localTime = DateTimeUtilities.GetLocalTime();
                    if (this.startTime == ExDateTime.MinValue)
                    {
                        this.startTime = new ExDateTime(base.UserContext.TimeZone, localTime.Year, localTime.Month, localTime.Day, localTime.Hour, localTime.Minute, 0);
                    }
                    else
                    {
                        this.startTime = new ExDateTime(base.UserContext.TimeZone, this.startTime.Year, this.startTime.Month, this.startTime.Day, localTime.Hour, localTime.Minute, 0);
                    }
                    if (this.isAllDayEvent && this.startTime.Hour == 23)
                    {
                        if (this.startTime.Minute >= 30)
                        {
                            this.startTime = this.startTime.Date;
                        }
                        else
                        {
                            this.startTime = new ExDateTime(base.UserContext.TimeZone, this.startTime.Year, this.startTime.Month, this.startTime.Day, 23, 0, 0);
                            this.endTime   = new ExDateTime(base.UserContext.TimeZone, this.startTime.Year, this.startTime.Month, this.startTime.Day, 23, 30, 0);
                        }
                    }
                    else if (this.startTime.Minute != 0 && this.startTime.Minute != 30)
                    {
                        this.startTime = this.startTime.AddMinutes((double)(30 - this.startTime.Minute % 30));
                    }
                }
                if (this.endTime == ExDateTime.MinValue)
                {
                    this.endTime = this.startTime.AddMinutes(60.0);
                }
                this.recipientWell       = new CalendarItemRecipientWell();
                this.bodyMarkup          = base.UserContext.UserOptions.ComposeMarkup;
                this.toolbar             = new EditCalendarItemToolbar(null, this.isMeeting, this.bodyMarkup, this.IsPublicItem);
                this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
                this.recurrenceUtilities = new RecurrenceUtilities(null, base.SanitizingResponse);
                return;
            }
        }
コード例 #3
0
 protected internal override void BuildInfobar()
 {
     CalendarUtilities.AddCalendarInfobarMessages(this.FormInfobar, this.CalendarItemBase, null, this.UserContext);
 }