/// <summary> /// Adds a temporal expression to the list /// </summary> /// <param name="expr">Temporal expression to add.</param> public void Add(TemporalExpression expr) { Expressions.Add(expr); }
public Schedule(Event aEvent, UnionTE excludedDates) { _event = aEvent; TemporalExpression = Create(excludedDates); }
/// <summary> /// Create and return a base schedule including exclusions if applicable. /// </summary> /// <param name="excludedDates">Holidays or any excluded dates</param> /// <returns>Complete schedule as an expression</returns> private TemporalExpression Create(TemporalExpression excludedDates) { var intersectionTE = new IntersectionTE(); // get a builder that knows how to create a UnionTE for the event frequency var builder = EventFrequencyBuilder.Create(_event); var union = builder.Create(); intersectionTE.Add(union); if (_event.RangeInYear != null) { var rangeEachYear = GetRangeForYear(_event); intersectionTE.Add(rangeEachYear); } return new DifferenceTE(intersectionTE, excludedDates); }
public Schedule(Event aEvent, IEnumerable<DateTime> excludedDates) { _event = aEvent; TemporalExpression = Create(excludedDates); }
public Schedule(Event aEvent) { _event = aEvent; TemporalExpression = Create(); }
public DifferenceTE(TemporalExpression inclusiveExpression, TemporalExpression exclusiveExpression) { _inclusiveExpression = inclusiveExpression; _exclusiveExpression = exclusiveExpression; }