/// <summary>
 /// Does the two periods intersect.
 /// </summary>
 /// <param name="period">The period.</param>
 /// <returns></returns>
 /// <remarks>
 /// Created by: micke
 /// Created date: 4.12.2007
 /// </remarks>
 public bool Intersect(TimePeriod period)
 {
     if (Contains(period.StartTime)||Contains(period.EndTime.Subtract(new TimeSpan(1))))
         return true;
     if (period.Contains(this))
         return true;
     //if (Contains(period)) this is the same as the row before
     //    return true;
     return false;
 }
        /// <summary>
        /// Determines whether the specified period contains part.
        /// </summary>
        /// <param name="period">The period.</param>
        /// <returns>
        /// 	<c>true</c> if the specified period contains part; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>
        /// Created by: peterwe
        /// Created date: 2007-11-13
        /// </remarks>
        public bool ContainsPart(TimePeriod period)
        {
            if (ContainsPart(period.StartTime) || ContainsPart(period.EndTime))
                return true;

            if (period.Contains(this))
                return true;

            return false;
        }