Esempio n. 1
0
        private void RenderAppointmentData(CalendarViewBase view, int i, ExDateTime itemStart, ExDateTime itemEnd)
        {
            ICalendarDataSource     dataSource      = view.DataSource;
            CalendarItemTypeWrapper wrappedItemType = dataSource.GetWrappedItemType(i);

            this.output.Write("new Item(\"");
            OwaStoreObjectId            itemId    = dataSource.GetItemId(i);
            string                      changeKey = dataSource.GetChangeKey(i);
            PublishedCalendarDataSource publishedCalendarDataSource = dataSource as PublishedCalendarDataSource;

            if (publishedCalendarDataSource != null && publishedCalendarDataSource.DetailLevel != DetailLevelEnumType.AvailabilityOnly)
            {
                StoreObjectId itemStoreObjectId = publishedCalendarDataSource.GetItemStoreObjectId(i);
                Utilities.JavascriptEncode(itemStoreObjectId.ToString(), this.output);
                this.output.Write("\",\"");
                if (this.IsOneOfRecurrence(wrappedItemType))
                {
                    StoreObjectId storeObjectId = StoreObjectId.FromProviderSpecificId(itemStoreObjectId.ProviderLevelItemId);
                    Utilities.JavascriptEncode(storeObjectId.ToString(), this.output);
                }
                else
                {
                    this.output.Write("0");
                }
            }
            else
            {
                if (itemId != null)
                {
                    Utilities.JavascriptEncode(itemId.ToString(), this.output);
                }
                this.output.Write("\",\"");
                if (itemId != null && this.IsOneOfRecurrence(wrappedItemType))
                {
                    OwaStoreObjectId providerLevelItemId = itemId.ProviderLevelItemId;
                    Utilities.JavascriptEncode(providerLevelItemId.ToString(), this.output);
                }
                else
                {
                    this.output.Write("0");
                }
            }
            this.output.Write("\",\"");
            if (changeKey != null)
            {
                Utilities.JavascriptEncode(changeKey, this.output);
            }
            this.output.Write("\",\"");
            this.output.Write(DateTimeUtilities.GetJavascriptDate(itemStart));
            this.output.Write("\",\"");
            this.output.Write(DateTimeUtilities.GetJavascriptDate(itemEnd));
            this.output.Write("\",\"");
            Utilities.JavascriptEncode(dataSource.GetSubject(i), this.output);
            this.output.Write("\",\"");
            Utilities.JavascriptEncode(dataSource.GetLocation(i), this.output);
            BusyTypeWrapper wrappedBusyType = dataSource.GetWrappedBusyType(i);

            this.output.Write("\",");
            this.output.Write((int)wrappedBusyType);
            this.output.Write(",\"");
            if (itemId != null)
            {
                Utilities.JavascriptEncode(ObjectClass.GetContainerMessageClass(itemId.StoreObjectType), this.output);
            }
            this.output.Write("\"");
            bool flag = dataSource.IsMeeting(i);

            this.output.Write(flag ? ",1" : ",0");
            this.output.Write(dataSource.IsCancelled(i) ? ",1" : ",0");
            bool flag2 = dataSource.IsOrganizer(i);

            this.output.Write(flag2 ? ",1" : ",0");
            this.output.Write(",\"");
            if (flag)
            {
                Utilities.JavascriptEncode(dataSource.GetOrganizerDisplayName(i), this.output);
            }
            this.output.Write("\"");
            bool flag3 = dataSource.IsPrivate(i);

            this.output.Write(flag3 ? ",1," : ",0,");
            this.output.Write((int)wrappedItemType);
            this.output.Write(dataSource.HasAttachment(i) ? ",1" : ",0");
            this.output.Write(",\"");
            this.output.Write(dataSource.GetCssClassName(i));
            this.output.Write("\"");
            this.output.Write(")");
        }