Beispiel #1
0
        public override void Render(int viewWidth, CalendarViewType viewType, ReadingPanePosition readingPanePosition, ReadingPanePosition requestReadingPanePosition)
        {
            SanitizedHtmlString sharedData = null;

            base.Output.Write("{\"rgCalendar\":[");
            if (this.dailyView != null)
            {
                this.RenderCalendar(0, this.dailyView);
                sharedData = this.GetSharedDataString(this.dailyView, viewWidth, viewType, readingPanePosition, requestReadingPanePosition);
            }
            else
            {
                base.RenderCalendars(this.adapters, this.days, delegate(CalendarAdapterBase calendarAdapter, int index)
                {
                    if (index > 0)
                    {
                        this.Output.Write(",");
                    }
                    DailyView view = new DailyView(this.SessionContext, calendarAdapter);
                    if (sharedData == null)
                    {
                        sharedData = this.GetSharedDataString(view, viewWidth, viewType, readingPanePosition, requestReadingPanePosition);
                    }
                    this.RenderCalendar(index, view);
                });
            }
            base.Output.Write("]");
            if (sharedData != null)
            {
                base.Output.Write(",");
                base.Output.Write(sharedData);
            }
            base.Output.Write("}");
        }
Beispiel #2
0
        private void RenderTimeSwoopVariables(TextWriter writer, DailyView view)
        {
            ExDateTime localTime = DateTimeUtilities.GetLocalTime();
            ExDateTime date      = localTime.Date;
            double     num;

            if (!DateRange.IsDateInRangeArray(localTime, view.DateRanges))
            {
                num = -1.0;
            }
            else
            {
                num = (double)(((DateTime)localTime).Ticks - ((DateTime)date).Ticks) / 600000000.0;
            }
            base.RenderValue(writer, "flTSW", num, "0.####");
            if (num >= 0.0)
            {
                double       value           = -1.0;
                double       num2            = -1.0;
                DaylightTime daylightChanges = base.SessionContext.TimeZone.GetDaylightChanges(localTime.Year);
                ExDateTime   utcNow          = ExDateTime.UtcNow;
                if (localTime.Day == daylightChanges.Start.Day && localTime.Month == daylightChanges.Start.Month)
                {
                    value = (double)(ExTimeZone.UtcTimeZone.ConvertDateTime(new ExDateTime(base.SessionContext.TimeZone, daylightChanges.Start)).UtcTicks - utcNow.UtcTicks) / 600000000.0;
                }
                if (localTime.Day == daylightChanges.End.Day && localTime.Month == daylightChanges.End.Month)
                {
                    num2  = (double)(ExTimeZone.UtcTimeZone.ConvertDateTime(new ExDateTime(base.SessionContext.TimeZone, daylightChanges.End)).UtcTicks - utcNow.UtcTicks) / 600000000.0;
                    num2 -= daylightChanges.Delta.TotalMinutes;
                }
                base.RenderValue(writer, "flDSO", value, "0.####");
                base.RenderValue(writer, "flDEO", num2, "0.####");
                base.RenderValue(writer, "flDSD", daylightChanges.Delta.TotalMinutes, "0.####");
            }
        }
Beispiel #3
0
 private void RenderCalDay(DailyView view)
 {
     for (int i = 0; i < view.ViewDays.Length; i++)
     {
         if (i > 0)
         {
             base.Output.Write(",");
         }
         SchedulingAreaVisualContainer schedulingAreaVisualContainer = view.ViewDays[i];
         base.Output.Write("new CalendarDay(");
         base.Output.Write(i.ToString(CultureInfo.InvariantCulture));
         base.Output.Write(", new Array(");
         int num = 0;
         for (int j = 0; j < view.RowFreeBusy[i].Length; j++)
         {
             if (j > 0)
             {
                 base.Output.Write(",");
             }
             BusyTypeWrapper busyTypeWrapper = view.RowFreeBusy[i][j];
             int             num2            = (int)busyTypeWrapper;
             if (num2 > num)
             {
                 num = num2;
             }
             base.Output.Write(num2);
         }
         base.Output.Write("),");
         base.Output.Write(num);
         int          minutesPerCell = (view.TimeStripMode == TimeStripMode.FifteenMinutes) ? 15 : 30;
         WorkingHours workingHours   = view.DataSource.WorkingHours;
         WorkingHours.WorkingPeriod[] workingHoursOnDay = workingHours.GetWorkingHoursOnDay(schedulingAreaVisualContainer.DateRange.Start);
         if (workingHoursOnDay.Length > 0)
         {
             ExDateTime date = schedulingAreaVisualContainer.DateRange.Start.Date;
             base.Output.Write(",");
             base.Output.Write(this.GetCellIndex(workingHoursOnDay[0].Start, minutesPerCell, date));
             base.Output.Write(",");
             base.Output.Write(this.GetCellIndex(workingHoursOnDay[0].End, minutesPerCell, date));
             if (workingHoursOnDay.Length > 1)
             {
                 base.Output.Write(",");
                 base.Output.Write(this.GetCellIndex(workingHoursOnDay[1].Start, minutesPerCell, date));
                 base.Output.Write(",");
                 base.Output.Write(this.GetCellIndex(workingHoursOnDay[1].End, minutesPerCell, date));
             }
         }
         base.Output.Write(")");
     }
 }
Beispiel #4
0
 private void RenderCalendar(int index, DailyView view)
 {
     base.Output.Write("{");
     base.RenderCalendarProperties(view);
     base.RenderValue(base.Output, "cERow", view.EventAreaRowCount);
     base.Output.Write("\"rgCalDay\":[");
     this.RenderCalDay(view);
     base.Output.Write("],\"rgItm\":[");
     base.RenderData(view, view.SelectedItemId);
     base.Output.Write("],\"rgVisData\":[");
     this.RenderScheduleAreaVis(index, view);
     base.Output.Write("],\"rgEvtData\":[");
     base.RenderEventAreaVisual(index, view, view.EventArea);
     base.Output.Write("]}");
 }
Beispiel #5
0
        private void RenderScheduleAreaVis(int iCalIdx, DailyView view)
        {
            bool flag = true;

            for (int i = 0; i < view.ViewDays.Length; i++)
            {
                SchedulingAreaVisualContainer schedulingAreaVisualContainer = view.ViewDays[i];
                for (int j = 0; j < schedulingAreaVisualContainer.Count; j++)
                {
                    SchedulingAreaVisual schedulingAreaVisual = (SchedulingAreaVisual)schedulingAreaVisualContainer[j];
                    if (!view.IsItemRemoved(schedulingAreaVisual.DataIndex))
                    {
                        if (!flag)
                        {
                            base.Output.Write(",");
                        }
                        flag = false;
                        base.Output.Write("new VisData(");
                        base.Output.Write(iCalIdx);
                        base.Output.Write(",");
                        int num = (base.ItemIndex != null) ? ((int)base.ItemIndex[schedulingAreaVisual.DataIndex]) : schedulingAreaVisual.DataIndex;
                        base.Output.Write(num);
                        base.Output.Write(",");
                        base.Output.Write(schedulingAreaVisual.Rect.X.ToString("0.####", CultureInfo.InvariantCulture));
                        base.Output.Write(",");
                        base.Output.Write(schedulingAreaVisual.Rect.Y.ToString("0.####", CultureInfo.InvariantCulture));
                        base.Output.Write(",");
                        base.Output.Write(schedulingAreaVisual.Rect.Width.ToString("0.####", CultureInfo.InvariantCulture));
                        base.Output.Write(",");
                        base.Output.Write(schedulingAreaVisual.Rect.Height.ToString("0.####", CultureInfo.InvariantCulture));
                        base.Output.Write(",");
                        base.Output.Write("0,0");
                        if (num == base.SelectedItemIndex)
                        {
                            base.Output.Write(",1,");
                        }
                        else
                        {
                            base.Output.Write(",0,");
                        }
                        base.Output.Write(i);
                        base.Output.Write(")");
                    }
                }
            }
        }
Beispiel #6
0
        private SanitizedHtmlString GetSharedDataString(DailyView view, int viewWidth, CalendarViewType viewType, ReadingPanePosition readingPanePosition, ReadingPanePosition requestReadingPanePosition)
        {
            SanitizedHtmlString result;

            using (SanitizingStringWriter <OwaHtml> sanitizingStringWriter = new SanitizingStringWriter <OwaHtml>())
            {
                base.RenderValue(sanitizingStringWriter, "sFId", base.SessionContext.CalendarFolderOwaIdString);
                base.RenderValue(sanitizingStringWriter, "sTimeZone", base.SessionContext.TimeZone.Id);
                base.RenderValue(sanitizingStringWriter, "iVT", (int)viewType);
                base.RenderValue(sanitizingStringWriter, "iVW", viewWidth);
                base.RenderValue(sanitizingStringWriter, "iRowH", 24);
                base.RenderValue(sanitizingStringWriter, "iRRP", (int)requestReadingPanePosition);
                base.RenderValue(sanitizingStringWriter, "iNRP", (int)readingPanePosition);
                this.RenderTimeSwoopVariables(sanitizingStringWriter, view);
                sanitizingStringWriter.Write("\"rgDay\":[");
                base.RenderDay(sanitizingStringWriter, view.DateRanges, viewType);
                sanitizingStringWriter.Write("]");
                result = sanitizingStringWriter.ToSanitizedString <SanitizedHtmlString>();
            }
            return(result);
        }
Beispiel #7
0
 public DailyViewPayloadWriter(ISessionContext sessionContext, TextWriter output, DailyView dailyView) : base(sessionContext, output)
 {
     if (dailyView == null)
     {
         throw new ArgumentNullException("dailyView");
     }
     this.dailyView = dailyView;
 }
Beispiel #8
0
        // Token: 0x06002432 RID: 9266 RVA: 0x000D1148 File Offset: 0x000CF348
        protected void RenderSecondaryNavigation(TextWriter output, bool showContacts)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            output.Write("<div id=\"{0}\" class=\"secNvPaneCont\">", this.lastModuleName);
            switch (this.navigationModule)
            {
            case NavigationModule.Mail:
                NavigationHost.RenderMailSecondaryNavigation(output, base.UserContext);
                goto IL_229;

            case NavigationModule.Calendar:
            {
                PropertyDefinition[] propsToReturn = new PropertyDefinition[]
                {
                    ViewStateProperties.CalendarViewType,
                    ViewStateProperties.DailyViewDays
                };
                using (CalendarFolder calendarFolder = CalendarFolder.Bind(base.UserContext.MailboxSession, DefaultFolderType.Calendar, propsToReturn))
                {
                    DailyView.RenderSecondaryNavigation(output, calendarFolder, base.UserContext);
                    goto IL_229;
                }
                break;
            }

            case NavigationModule.Contacts:
                break;

            case NavigationModule.Tasks:
                TaskView.RenderSecondaryNavigation(output, base.UserContext);
                goto IL_229;

            case NavigationModule.Options:
                goto IL_21D;

            case NavigationModule.AddressBook:
                this.recipientBlockType = ((AddressBook)this).RecipientBlockType;
                if (base.UserContext.IsFeatureEnabled(Feature.GlobalAddressList))
                {
                    bool isRoomPicker = ((AddressBook)this).IsRoomPicker && DirectoryAssistance.IsRoomsAddressListAvailable(base.UserContext);
                    output.Write("<div class=\"abNavPane\" style=\"height:");
                    output.Write(showContacts ? "30" : "100");
                    output.Write("%;top:0px;\"><div id=\"divMdNmAD\">");
                    output.Write(LocalizedStrings.GetHtmlEncoded(346766088));
                    output.Write("</div><div id=\"divSecNvAD\">");
                    DirectoryView.RenderSecondaryNavigation(output, base.UserContext, isRoomPicker);
                    output.Write("</div></div>");
                }
                if (showContacts)
                {
                    output.Write("<div class=\"abNavPane\" style=\"height:");
                    output.Write(base.UserContext.IsFeatureEnabled(Feature.GlobalAddressList) ? "70" : "100");
                    output.Write("%;bottom:0px;\"><div id=\"divMdNmC\">");
                    output.Write(LocalizedStrings.GetHtmlEncoded(-1165546057));
                    output.Write("</div><div id=\"divSecNvC\"");
                    bool isPicker = ((AddressBook)this).IsPicker;
                    if (isPicker)
                    {
                        output.Write(" class=\"noFltrsCntRg\"");
                    }
                    output.Write(">");
                    ContactView.RenderSecondaryNavigation(output, base.UserContext, isPicker);
                    output.Write("</div></div>");
                    goto IL_229;
                }
                goto IL_229;

            case NavigationModule.Documents:
                DocumentLibraryUtilities.RenderSecondaryNavigation(output, base.UserContext);
                goto IL_229;

            case NavigationModule.PublicFolders:
                NavigationHost.RenderPublicFolderSecondaryNavigation(output, base.UserContext);
                goto IL_229;

            default:
                goto IL_21D;
            }
            ContactView.RenderSecondaryNavigation(output, base.UserContext, false);
            goto IL_229;
IL_21D:
            NavigationHost.RenderMailSecondaryNavigation(output, base.UserContext);
IL_229:
            output.Write("</div>");
        }