コード例 #1
0
        protected override IEnumerable <Event> OnExecute()
        {
            EventDataProvider eventDataProvider    = this.Scope.EventDataProvider;
            IEnumerable <PropertyDefinition> first = eventDataProvider.MapProperties(FindEvents.HardCodedProperties);

            PropertyDefinition[] array = first.Concat(FindEvents.HardCodedPropertyDependencies).ToArray <PropertyDefinition>();
            bool includeSeriesMasters;

            if (this.Context == null || !this.Context.TryGetCustomParameter <bool>("ReturnSeriesMaster", out includeSeriesMasters))
            {
                includeSeriesMasters = false;
            }
            bool flag = this.Context != null && this.Context.RequestedProperties != null && FindEvents.NeedsReread(this.Context.RequestedProperties, this.Trace);
            IEnumerable <Event> calendarView = eventDataProvider.GetCalendarView(this.Parameters.EffectiveStartTime, this.Parameters.EffectiveEndTime, includeSeriesMasters, flag ? this.Scope.EventDataProvider.MapProperties(FindEvents.IdProperty).ToArray <PropertyDefinition>() : array);

            if (flag)
            {
                int count = (this.Context != null) ? this.Context.PageSizeOnReread : 20;
                return((from x in calendarView.Take(count)
                        select this.Scope.Read(x.Id, this.Context)).ToList <Event>());
            }
            EventTimeAdjuster adjuster        = this.Scope.TimeAdjuster;
            ExTimeZone        sessionTimeZone = this.Scope.Session.ExTimeZone;

            return(from e in calendarView
                   select adjuster.AdjustTimeProperties(e, sessionTimeZone));
        }
コード例 #2
0
        protected override IEnumerable <Event> OnExecute()
        {
            EventDataProvider eventDataProvider = this.Scope.EventDataProvider;

            Microsoft.Exchange.Data.PropertyDefinition[] array = base.Properties.ToArray <Microsoft.Exchange.Data.PropertyDefinition>();
            bool flag = this.Context != null && this.Context.RequestedProperties != null && FindEvents.NeedsReread(this.Context.RequestedProperties, this.Trace);
            IEnumerable <Event> source  = eventDataProvider.Find(base.QueryFilter, base.SortColumns, flag ? this.Scope.EventDataProvider.MapProperties(FindEvents.IdProperty).ToArray <Microsoft.Exchange.Data.PropertyDefinition>() : array);
            IEnumerable <Event> source2 = base.QueryOptions.ApplySkipTakeTo(source.AsQueryable <Event>());

            if (flag)
            {
                int count = (this.Context != null) ? this.Context.PageSizeOnReread : 20;
                return((from x in source2.Take(count)
                        select this.Scope.Read(x.Id, this.Context)).ToList <Event>());
            }
            EventTimeAdjuster adjuster        = this.Scope.TimeAdjuster;
            ExTimeZone        sessionTimeZone = this.Scope.Session.ExTimeZone;

            return(from e in source2
                   select adjuster.AdjustTimeProperties(e, sessionTimeZone));
        }