Exemplo n.º 1
0
        public virtual IEnumerable <LocalInterval> GetIntervals(LocalInterval interval, DateTimeZone destinationTimezone)
        {
            var maskIntervals    = mask.GetIntervals(interval, destinationTimezone);
            var contentIntervals = payload.GetIntervals(interval, destinationTimezone);

            return(TimeMathOld.Intersection(contentIntervals, maskIntervals).OrderBy(i => i.Start));
        }
Exemplo n.º 2
0
        public IEnumerable <LocalInterval> GetIntervals(LocalInterval interval = null)
        {
            if (layers.Count == 0)
            {
                return(GetLocalIntervals(interval));
            }

            List <LocalInterval> currIntervals = GetLocalIntervals(interval).ToList();
            var currTimeline = new TimelineMask(Timezone, currIntervals);

            foreach (var layer in layers)
            {
                var nextIntervals = layer.Value.GetIntervals(interval, Timezone).ToList();

                var flat = layer.Key(currIntervals, nextIntervals).ToList();
                currTimeline  = new TimelineMask(Timezone, flat);
                currIntervals = currTimeline.GetIntervals(interval, Timezone).ToList();
            }

            return(currTimeline.GetIntervals(interval));
        }