public void AddTaxFacts(IList <int> list) { IntervalList intervals = list as IntervalList; if (intervals == null) { intervals = new IntervalList(); foreach (var item in list) { intervals.Add(item); } } //this.TaxFacts.Add(intervals); this.TaxFacts.Add((List <int>)list); }
/// <inheritdoc /> public BoundedPeriodSet(DateTime from, DateTime?to = null) { Start <DateTime> start = new Start <DateTime>(from, Inclusivity.Inclusive); if (to.HasValue) { if (to.Value == from) { IntervalList.Add(new DefaultDegenerateInterval <DateTime>(new Degenerate <DateTime>(from))); } else { IntervalList.Add(new DefaultStartEndingInterval <DateTime>(start, new End <DateTime>(to.Value, Inclusivity.Exclusive))); } } else { IntervalList.Add(new DefaultStartingInterval <DateTime>(start)); } }
/// <inheritdoc /> public OpenPeriodSet(DateTime from, DateTime?to) { Start <DateTime> start = new Start <DateTime>(from, Inclusivity.Inclusive); if (to.HasValue) { if (to.Value == from) { IntervalList.Add(new DegenerateOpenPeriod(new Degenerate <DateTime>(from))); } else { IntervalList.Add(new StartEndingOpenPeriod(start, new End <DateTime>(to.Value, Inclusivity.Exclusive))); } } else { IntervalList.Add(new StartingOpenPeriod(start)); } }