/// <summary> /// 대상 TimePeriod와 기간이 겹치는 TimePeriod 요소가 존재하는가? /// </summary> /// <param name="target"></param> /// <returns></returns> public virtual bool HasOverlapPeriods(ITimePeriod target) { var result = _periods.Any(p => target.OverlapsWith(p)); if(IsDebugEnabled) log.Debug("target[{0}]과 기간이 겹치는 요소가 존재하는가? [{1}]", target, result); return result; }
/// <summary> /// 대상 TimePeriod와 기간이 겹치는 TimePeriod 요소가 존재하는가? /// </summary> /// <param name="target"></param> /// <returns></returns> public virtual bool HasOverlapPeriods(ITimePeriod target) { var result = _periods.Any(p => target.OverlapsWith(p)); if (IsDebugEnabled) { log.Debug("target[{0}]과 기간이 겹치는 요소가 존재하는가? [{1}]", target, result); } return(result); }
} // HasGaps // ---------------------------------------------------------------------- public virtual bool HasOverlapPeriods(ITimePeriod test) { if (test == null) { throw new ArgumentNullException("test"); } foreach (ITimePeriod period in periods) { if (test.OverlapsWith(period)) { return(true); } } return(false); } // HasOverlapPeriods
} // HasOverlapPeriods // ---------------------------------------------------------------------- public virtual ITimePeriodCollection OverlapPeriods(ITimePeriod test) { if (test == null) { throw new ArgumentNullException("test"); } TimePeriodCollection overlapPeriods = new TimePeriodCollection(); foreach (ITimePeriod period in periods) { if (test.OverlapsWith(period)) { overlapPeriods.Add(period); } } return(overlapPeriods); } // OverlapPeriods
/// <summary> /// <paramref name="target"/> 기간과 겹치는 TimePeriod 들을 열거합니다. /// </summary> /// <param name="target"></param> /// <returns></returns> public virtual IEnumerable <ITimePeriod> OverlapPeriods(ITimePeriod target) { return(_periods.Where(p => target.OverlapsWith(p))); }
/// <summary> /// <paramref name="target"/> 기간과 겹치는 TimePeriod 들을 열거합니다. /// </summary> /// <param name="target"></param> /// <returns></returns> public virtual IEnumerable<ITimePeriod> OverlapPeriods(ITimePeriod target) { return _periods.Where(p => target.OverlapsWith(p)); }
// ---------------------------------------------------------------------- public virtual ITimePeriodCollection OverlapPeriods( ITimePeriod test ) { if ( test == null ) { throw new ArgumentNullException( "test" ); } TimePeriodCollection overlapPeriods = new TimePeriodCollection(); foreach ( ITimePeriod period in periods ) { if ( test.OverlapsWith( period ) ) { overlapPeriods.Add( period ); } } return overlapPeriods; }
// ---------------------------------------------------------------------- public virtual bool HasOverlapPeriods( ITimePeriod test ) { if ( test == null ) { throw new ArgumentNullException( "test" ); } foreach ( ITimePeriod period in periods ) { if ( test.OverlapsWith( period ) ) { return true; } } return false; }