Beispiel #1
0
            public TimePeriodList SelectTimePeriodsRecursive(DateTime since, DateTime till)
            {
                var nodes = Childs.SelectRecursiveList(n => n.Childs);

                nodes.Insert(0, this);
                TimePeriodList periods = new TimePeriodList();

                foreach (var node in nodes)
                {
                    periods.AddRange(node.TimePeriods.Where(p => p.Since > since && p.Till < till));
                }

                periods.Sort(delegate(TimePeriod a, TimePeriod b) { return(a.Since < b.Since ? -1 : 1); });
                return(periods);
            }