Esempio n. 1
0
        /// <summary>
        ///     Check if two time periods overlaps
        /// </summary>
        /// <param name="other"></param>
        /// <returns><c>true</c> in case of overlapping</returns>
        public bool Overlaps(TimePeriod other)
        {
            var thisBegin = Begin.GetSerial();
            var thisEnd = End.GetSerial();
            var otherBegin = other.Begin.GetSerial();
            var otherEnd = other.End.GetSerial();

            return otherBegin < thisEnd && otherEnd > thisBegin ||
                   otherEnd > thisBegin && otherEnd < thisEnd;
        }