예제 #1
0
 private bool Equals(CalDateTime other)
 {
     return(Value.Equals(other.Value) &&
            HasDate == other.HasDate &&
            AsUtc.Equals(other.AsUtc) &&
            string.Equals(TzId, other.TzId, StringComparison.OrdinalIgnoreCase));
 }
예제 #2
0
        public List <Period> Evaluate(CalDateTime startDate, CalDateTime fromDate, CalDateTime endDate)
        {
            var periods = new List <Period>(Periods.Count);

            if (startDate > fromDate)
            {
                fromDate = startDate;
            }

            if (endDate < fromDate || fromDate > endDate)
            {
                return(periods);
            }

            var uncollectedPeriodQuery = from Period p in Periods
                                         where !periods.Contains(p)
                                         select p;

            periods.AddRange(uncollectedPeriodQuery);
            return(periods);
        }