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