/// <summary> /// <paramref name="target"/> 기간과 기간이 교차하는 TimePeriod 요소가 존재하는가? /// </summary> /// <param name="target"></param> /// <returns></returns> public virtual bool HasIntersectionPeriods(ITimePeriod target) { var result = _periods.Any(p => target.IntersectsWith(p)); if(IsDebugEnabled) log.Debug("target[{0}]과 기간이 교차하는 요소가 존재하는가? [{1}]", target, result); return result; }
/// <summary> /// <paramref name="target"/> 기간과 기간이 교차하는 TimePeriod 요소가 존재하는가? /// </summary> /// <param name="target"></param> /// <returns></returns> public virtual bool HasIntersectionPeriods(ITimePeriod target) { var result = _periods.Any(p => target.IntersectsWith(p)); if (IsDebugEnabled) { log.Debug("target[{0}]과 기간이 교차하는 요소가 존재하는가? [{1}]", target, result); } return(result); }
} // HasIntersectionPeriods // ---------------------------------------------------------------------- public virtual ITimePeriodCollection IntersectionPeriods(ITimePeriod test) { if (test == null) { throw new ArgumentNullException("test"); } TimePeriodCollection intersectionPeriods = new TimePeriodCollection(); foreach (ITimePeriod period in periods) { if (test.IntersectsWith(period)) { intersectionPeriods.Add(period); } } return(intersectionPeriods); } // IntersectionPeriods
// ---------------------------------------------------------------------- public virtual ITimePeriodCollection IntersectionPeriods( ITimePeriod test ) { if ( test == null ) { throw new ArgumentNullException( "test" ); } TimePeriodCollection intersectionPeriods = new TimePeriodCollection(); foreach ( ITimePeriod period in periods ) { if ( test.IntersectsWith( period ) ) { intersectionPeriods.Add( period ); } } return intersectionPeriods; }