Exemple #1
0
        public override IEnumerable <DateTime?> Adjust(DateTimeFormula Offset, DateTime MinDate, DateTime MaxDate, DateTime StartDate)
        {
            //AFter = Min, Max, Current
            //Before = Max, Min, Current

            var Query =
                from x in Position.Occurances(MinDate, MaxDate, StartDate)
                let NewMin = (Location == TimeAdjustmentLocation.After ? MinDate : MaxDate)
                             let NewMax = (Location == TimeAdjustmentLocation.After ? MaxDate : MinDate)
                                          let Adjusted = Offset.Occurances(NewMin, NewMax, x.Value).FirstOrDefault()
                                                         where Adjusted != null
                                                         select Adjusted
            ;

            return(Query);
        }
Exemple #2
0
        public static T Offset <T>(this T DateFinder, TimeAdjustmentLocation Location, DateTimeFormula Position) where T : IContainsAdjustments
        {
            var Adjuster = new PositionalDateTimeAdjuster();

            Adjuster.Location = Location;
            Adjuster.Position = Position;

            DateFinder.Adjustments.Add(Adjuster);

            return(DateFinder);
        }
Exemple #3
0
 public static T After <T>(this T DateFinder, DateTimeFormula Position) where T : IContainsAdjustments
 {
     return(DateFinder.Offset(TimeAdjustmentLocation.After, Position));
 }
 public abstract IEnumerable <DateTime?> Adjust(DateTimeFormula Source, DateTime MinDate, DateTime MaxDate, DateTime StartDate);