コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        } // 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
コード例 #4
0
        } // 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
コード例 #5
0
 /// <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)));
 }
コード例 #6
0
 /// <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));
 }
コード例 #7
0
        // ----------------------------------------------------------------------
        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;
        }
コード例 #8
0
        // ----------------------------------------------------------------------
        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;
        }